From 6db217b36aff4f9231964583b4d36e4b46f0eac2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 9 Feb 2017 18:27:51 -0800 Subject: [PATCH] remove some sleep delays from PhysicsServerExample physics loop. --- .../SharedMemory/PhysicsServerExample.cpp | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index 1510475c6..4c9ae62fe 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -299,7 +299,6 @@ void MotionThreadFunc(void* userPtr,void* lsMemory) double deltaTimeInSeconds = 0; - double sleepCounter = 0; do { BT_PROFILE("loop"); @@ -310,27 +309,7 @@ void MotionThreadFunc(void* userPtr,void* lsMemory) } double dt = double(clock.getTimeMicroseconds())/1000000.; clock.reset(); - - sleepCounter+=dt; - - if (sleepCounter > sleepTimeThreshold) - { - BT_PROFILE("usleep(100)"); - sleepCounter = 0; - b3Clock::usleep(100); - - } - - { - if (gEnableRealTimeSimVR) - { - BT_PROFILE("usleep(1000)"); - b3Clock::usleep(1000); - } - } deltaTimeInSeconds+= dt; - - {