dbf-halloween2015
diff src/timer.h @ 0:50683c78264e
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 00:09:12 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/timer.h Sun Nov 01 00:09:12 2015 +0200 1.3 @@ -0,0 +1,29 @@ 1.4 +#ifndef TIMER_H_ 1.5 +#define TIMER_H_ 1.6 + 1.7 +unsigned long get_time_msec(void); 1.8 +void sleep_msec(unsigned long msec); 1.9 + 1.10 +double get_time_sec(void); 1.11 +void sleep_sec(double sec); 1.12 + 1.13 + 1.14 +class Timer { 1.15 +private: 1.16 + unsigned long start_time, pause_time; 1.17 + 1.18 +public: 1.19 + Timer(); 1.20 + 1.21 + void reset(); 1.22 + 1.23 + void start(); 1.24 + void stop(); 1.25 + 1.26 + bool is_running() const; 1.27 + 1.28 + unsigned long get_msec() const; 1.29 + double get_sec() const; 1.30 +}; 1.31 + 1.32 +#endif // TIMER_H_