summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/tracker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir/tracker.cpp')
-rw-r--r--facetracknoir/tracker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index 4a80c722..09edd45b 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -141,8 +141,10 @@ void Tracker::run() {
raw_6dof = final_raw;
}
- const long q = 1000L * std::max(0L, sleep_ms - t.elapsed_ms());
- usleep(q);
+ double q = sleep_ms * 1000L;
+ q -= t.elapsed();
+ q = std::max(0., q);
+ usleep((long)q);
}
#if defined(_WIN32)