diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-24 11:27:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-24 11:27:38 +0200 |
commit | 57ba66277c80d89038baeb06f8ff398935724879 (patch) | |
tree | 539fd3fefae3cbced306434c75284773433db401 /opentrack-compat | |
parent | 603130ef841ea23e317ccfa47385099b4466d8d5 (diff) |
timer: sprinkle some const
Diffstat (limited to 'opentrack-compat')
-rw-r--r-- | opentrack-compat/timer.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/opentrack-compat/timer.hpp b/opentrack-compat/timer.hpp index 8192aa83..1d424832 100644 --- a/opentrack-compat/timer.hpp +++ b/opentrack-compat/timer.hpp @@ -54,7 +54,7 @@ static inline void clock_gettime(int, struct timespec* ts) class Timer { private: struct timespec state; - long long conv(const struct timespec& cur) + long long conv(const struct timespec& cur) const { return (cur.tv_sec - state.tv_sec) * 1000000000LL + (cur.tv_nsec - state.tv_nsec); } @@ -65,12 +65,12 @@ public: void start() { (void) clock_gettime(CLOCK_MONOTONIC, &state); } - long long elapsed() { + long long elapsed() const { struct timespec cur; (void) clock_gettime(CLOCK_MONOTONIC, &cur); return conv(cur); } - long elapsed_ms() { + long elapsed_ms() const { return elapsed() / 1000000L; } }; |