Provides a set of methods that you can use to measure elapsed time.
Stopwatch(start: bool = false)
Construct an Stopwatch
Parameters | |
start |
true to start the Stopwatch immediately. Default: false
|
void start()
Starts, or resumes, measuring elapsed time.
void stop()
Stops measuring elapsed time.
void reset()
Stops measurement and resets the elapsed time to zero.
void restart()
Stops measurement, resets the elapsed time to zero, and starts measuring elapsed time.
number elapsed()
Gets the total elapsed time in ms.
Return | |
number | The total elapsed time |
bool isRunning()
Gets a value indicating whether the Stopwatch timer is running.
Return | |
bool | true if is running |
bool isElapsed(time: number)
Gets a value indicating whether the elapsed time has exceeded the specified time.
Parameters | |
time | The time to check in ms. |
Return | |
bool | true if has elapsed |
© 2024 - Macrorify by KoK-CODE