Module lzmq.timer
Working with time intervals.
Functions
-
sleep (ms)
-
Sleep current thread.
Parameters:
- ms
number
timeout in milliseconds.
-
monotonic ([duration])
-
Create monotonic timer.
Parameters:
- duration
number
milliseconds to fire
Returns:
timer
-
absolute ([time])
-
Create absolute timer.
Absolute timer works with UTC unix time.
Parameters:
Returns:
timer
-
absolute_time ()
-
Get absolute time.
Returns:
number
time
-
absolute_delta (start, finish)
-
Get duration between two absolute times.
Parameters:
- start
number
- finish
number
Returns:
number
duration in milliseconds
-
absolute_elapsed (start)
-
Get duration since specific absolute time.
Parameters:
Returns:
number
duration in milliseconds
-
monotonic_time ()
-
Get monotonic time.
Returns:
number
time
-
monotonic_delta (start, finish)
-
Get duration between two monotonic times.
Parameters:
- start
number
- finish
number
Returns:
number
duration in milliseconds
-
monotonic_elapsed (start)
-
Get duration since specific monotonic time.
Parameters:
Returns:
number
duration in milliseconds
Class timer
-
timer:close ()
-
Close timer
-
timer:closed ()
-
Check if this timer has been closed.
-
timer:set (time)
-
Set fire time.
Parameters:
- time
number
For absolute timer this is UTC unix time.
For monotonic timer this is duration in milliseconds.
-
timer:get ()
-
Get fire time.
Returns:
number
time
-
timer:reset ()
-
Clear fire time.
-
timer:setted ()
-
Check if timer has setted fire time.
-
timer:start ([time])
-
Start/Restart the timer.
Parameters:
-
timer:started ()
-
Check if this timer has been started.
-
timer:elapsed ()
-
Get duration since start.
Returns:
number
duration in milliseconds
-
timer:rest ()
-
Get rest time to fire.
Returns:
number
duration in milliseconds
-
timer:stop ()
-
Stop timer.
Returns:
number
duration in milliseconds
-
timer:is_absolute ()
-
Chick if this timer is absolute
-
timer:is_monotonic ()
-
Chick if this timer is monotonic