TimerUtil
This is a timer utility that allows to keep track of time and run certain code on a specified interval

Creation

1
var timerUtil = client.createTimer()
Copied!
Returns a TimerUtil object.

Functions

getTime

1
timerUtil.getTime()
Copied!
Returns the current time of the timer as a Number

reset

1
timerUtil.reset()
Copied!
This will reset the time elapsed

hasTimeElapsed

1
timerUtil.hasTimeElapsed(1000)
2
​
3
//or
4
​
5
timerUtil.hasTimeElapsed(1000, true)
Copied!
Returns true if the timer has elapsed the specified time
Parameter
Type
Description
time
Number
The time elapsed to check in milliseconds
reset (Optional)
Boolean
Set to true if you want to reset the time elapsed if the method returned true
Last modified 8mo ago