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())
50 while (C::now() < time)
52 boost::this_thread::yield();