summaryrefslogtreecommitdiffhomepage
path: root/opentrack/tracker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-27 08:42:23 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-10-27 08:42:23 +0100
commit74ec16767df99cf2f49afe3ba61da8489ec816ac (patch)
treeff48925d9ac03e78ec4780109a24983346a717d5 /opentrack/tracker.cpp
parent8c2b4d54e17c172391e4a1f0952f3417c2b2c496 (diff)
fix tracker sleep_ms to correctly compute overhead
Diffstat (limited to 'opentrack/tracker.cpp')
-rw-r--r--opentrack/tracker.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp
index 7e6919a3..c96bb9b4 100644
--- a/opentrack/tracker.cpp
+++ b/opentrack/tracker.cpp
@@ -197,10 +197,8 @@ void Tracker::run() {
libs.pTracker->data(newpose);
logic();
- double q = sleep_ms * 1000L;
- q -= t.elapsed();
- q = std::max(0., q);
- usleep((long)q);
+ long q = sleep_ms * 1000L - t.elapsed()/1000L;
+ usleep(q);
}
{