Regular API function


Description Waits for a certain amount of time. See also sim.waitForSignal.
C synopsis
C parameters
C return value
Lua synopsis float deltaTimeLeft=sim.wait(int deltaTime,boolean simulationTime=true)
Lua parameters
deltaTime: the minimum time duration to wait.
simulationTime: indicates whether we want to wait in terms of simulation- or real-time.
Lua return values
deltaTimeLeft: the "wait resolution" of this function is the simulation time step, and the sim.wait command may overshoot the requested waiting time. deltaTimeLeft is the negative overshoot time. If the function was called at simulation time X, and the function returned at simulation time Y, then deltaTimeLeft is deltaTime-(Y-X). deltaTimeLeft is also memorized internally on a thread-basis and used as compensation or correction factor in subsequent blocking commands. deltaTimeLeft is 0 if the simulationTime argument was false