timer¶
-
class
uv.
timer
()¶ A timer class, providing similar functionality of the default
setTimeout
, andsetRepeat
-
uv.timer.
start
(timeout, repeat, callback, arguments)¶ Start the timer.
Arguments: - timeout (int) – The time that the timer should wait before first calling the callback (in milliseconds).
- repeat (int) – The time between repeat calls of the timer (in milliseconds).
- callback (function) – The callback that should be called every time that this timer ticks.
- arguments (Array) – arguments to pass to the callback function
-
uv.timer.
stop
()¶ Stop the timer.
Throws: If the timer is not running.
-
uv.timer.
again
()¶ Start the timer with the parameters specified before, after a
stop()
call has been made.Throws: If this is the timer’s first go.
-
uv.timer.
set_repeat
(repeat)¶ Set the time between repeat calls of this timer.
Arguments: - repeat (int) – The time between repeat calls of the timer (in milliseconds).
Throws: If the timer has not been started.
-
uv.timer.
get_repeat
()¶ Get the time between repeat calls of this timer.
Returns: An integer representing the time between repeat calls of this timer (in milliseconds).
-