16 #ifndef SURGSIM_FRAMEWORK_CLOCK_H 17 #define SURGSIM_FRAMEWORK_CLOCK_H 19 #include <boost/chrono.hpp> 20 #include <boost/thread.hpp> 32 typedef boost::chrono::high_resolution_clock
Clock;
38 template <
class C,
class D>
42 static const boost::chrono::duration<double> schedulerError(0.002);
44 boost::chrono::time_point<C, D> earlierTime = time - schedulerError;
45 if (earlierTime > C::now())
47 boost::this_thread::sleep_until(earlierTime);
50 while (C::now() < time)
52 boost::this_thread::yield();
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void sleep_until(const boost::chrono::time_point< C, D > &time)
A more accurate sleep_until that accounts for scheduler errors.
Definition: Clock.h:39
boost::chrono::high_resolution_clock Clock
Wraps around the actual clock we are using.
Definition: Clock.h:32