MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / sleepUntil

Method sleepUntil

okvis_ros/okvis/okvis_time/src/Time.cpp:265–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265bool Time::sleepUntil(const Time& end) {
266 if (Time::useSystemTime()) {
267 Duration d(end - Time::now());
268 if (d > Duration(0)) {
269 return d.sleep();
270 }
271
272 return true;
273 } else {
274 Time start = Time::now();
275 while ((Time::now() < end)) {
276 okvis_nanosleep(0, 1000000);
277 if (Time::now() < start) {
278 return false;
279 }
280 }
281
282 return true;
283 }
284}
285
286bool WallTime::sleepUntil(const WallTime& end) {
287 WallDuration d(end - WallTime::now());

Callers

nothing calls this directly

Calls 4

DurationClass · 0.85
okvis_nanosleepFunction · 0.85
WallDurationClass · 0.85
sleepMethod · 0.80

Tested by

no test coverage detected