-
Notifications
You must be signed in to change notification settings - Fork 103
Timer
The Timer class provides basic timing and seeking functions. A Timer is provided by the CubicVR.MainLoop loop function callback.
Start the timer and initialize time to 0.
Returns:
none
Update the timer for the current frame and step the timer. This will be called automatically by MainLoop.
Returns:
none
Stop the timer and mark the end_time property.
Returns:
none
Start the timer and reset time to 0.
Returns:
none
Force time intervals to f_rate frames per second regardless of actual time.
Parameters:
-
f_rate
: Frames per second.
Returns:
none
Disable any calls to lockFramerate(..)
.
Returns:
none
Checks if the timer is locked or not.
Returns:
true
if framerate is locked, false
if not.
Get the current time in Milliseconds.
Returns:
Time in Milliseconds
Get the current time in Seconds.
Returns:
Time in Seconds.
Set the current time in Milliseconds.
Parameters:
-
milliseconds
: Millseconds to set the time to.
Returns:
none
Set the current time in Seconds.
Parameters:
-
seconds
: Seconds to set the time to.
Returns:
none
Return the time interval between this update and last in Seconds.
Returns:
Time interval betwen update() in Seconds.
Return the time interval between this update and last in Milliseconds.
Returns:
Time interval betwen update() in Milliseconds
Get the total time (excluding pauses and time shifts).
Returns:
Total time in Milliseconds.
Get the total time (excluding pauses and time shifts).
Returns:
Total time in Seconds
Get the total number of calls to update().
Returns:
Total number of calls to update()
.
Set the paused state of the timer. While paused the timer will continue to run but maintain the current time.
Parameters:
paused - true
or false
to pause or unpause, respectively.
Returns:
none
Return the paused state of the timer.
Returns:
true
if paused, false
if not.