diff options
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 3 | ||||
-rw-r--r-- | opentrack/timer.hpp | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 2fd5a514..05e7b067 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -59,7 +59,8 @@ void Tracker::run() while((commands & ABORT) == 0) { apply_inner(); - const double dt = time.start() * 1e-9; + const double dt = time.elapsed() * 1e-9; + time.start(); cv::Mat frame; const bool new_frame = camera.get_frame(dt, &frame); diff --git a/opentrack/timer.hpp b/opentrack/timer.hpp index 93c0a1f4..1b52b6c8 100644 --- a/opentrack/timer.hpp +++ b/opentrack/timer.hpp @@ -51,12 +51,8 @@ public: Timer() { start(); } - long start() { - struct timespec cur; - (void) clock_gettime(CLOCK_MONOTONIC, &cur); - long ret = conv(cur); - state = cur; - return ret; + void start() { + (void) clock_gettime(CLOCK_MONOTONIC, &state); } long elapsed() { struct timespec cur; |