Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Timer class taken from Lazy Foo' Productions [http://lazyfoo.net/index.php]*/
- #ifndef TIMER_H
- #define TIMER_H
- class Timer
- {
- private:
- int interval;
- //The clock time when the timer started
- int startTicks;
- //The ticks stored when the timer was paused
- int pausedTicks;
- //The timer status
- bool paused;
- bool started;
- public:
- //Initializes variables
- Timer();
- //The various clock actions
- void start();
- void stop();
- void pause();
- void unpause();
- void setInterval(int value);
- int getInterval();
- //Gets the timer's time
- int get_ticks();
- //Checks the status of the timer
- bool is_started();
- bool is_paused();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement