LitDev Extension API
LDStopwatch
Accurate system stopwatches.
Add | DelayUpTo | ElapsedMilliseconds |
ElapsedTicks | Frequency | Reset |
Restart | Start | Stop |
Add()
Create a new stopwatch.
returns The stopwatch name.
DelayUpTo(delay)
Delay up to a maximum interval since the last time this is called.
Useful in a game loop to maintain an even play speed.
delay The maximum delay in ms.
ElapsedMilliseconds(stopwatch)
Gets the total elapsed time measured in milliseconds.
stopwatch The stopwatch name.
returns Elapsed milliseconds.
ElapsedTicks(stopwatch)
Gets the total elapsed time measured in timer ticks for very short intervals.
stopwatch The stopwatch name.
returns Elapsed ticks.
Frequency
Get the frequency of the stopwatch timer in ticks per second.
This represents the finest resolution of time your hardware can measure with ElapsedTicks.
Reset(stopwatch)
Stops the current stopwatch and resets the elapsed time to 0.
stopwatch The stopwatch name.
Restart(stopwatch)
Stops the current stopwatch, resets the elapsed time to 0 and restarts the stopwatch.
stopwatch The stopwatch name.
Start(stopwatch)
Starts or resumes the current stopwatch.
stopwatch The stopwatch name.
Stop(stopwatch)
Stops the current stopwatch.
stopwatch The stopwatch name.