diff options
Diffstat (limited to 'time.h')
-rw-r--r-- | time.h | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -0,0 +1,34 @@ +#ifndef TIME_H +#define TIME_H + +#include <SFML/System/Clock.hpp> + +class Clock { + private: + sf::Clock clock; + bool running; + float base; + + public: + Clock(); + + void reset(); + void start(); + void stop(); + + float elapsed() const; +}; + +class Timer { + private: + const Clock& clock; + float starttime; + + public: + Timer(const Clock& clock_); + + void reset(); + float elapsed() const; +}; + +#endif |