Add sleep to avoid 100% busy CPU loop in PhysicsServerExample

Added btClock::usleep
Fix broken TinyRenderer example code.
This commit is contained in:
erwin coumans
2016-08-13 12:21:18 -07:00
parent 238ba8c642
commit 3bdcf23a05
9 changed files with 61 additions and 13 deletions

View File

@@ -28,6 +28,10 @@ public:
/// the Clock was created.
double getTimeInSeconds();
///Sleep for 'microSeconds', to yield to other threads and not waste 100% CPU cycles.
///Note that some operating systems may sleep a longer time.
static void usleep(int microSeconds);
private:
struct b3ClockData* m_data;
};