NodeTimerRef

From Minetest Developer Wiki
(Redirected from NodeTimerRef:get elapsed)
Jump to: navigation, search

A high resolution persistent per-node timer. Can be gotten via minetest.get_node_timer(pos)

Methods

  • set(timeout, elapsed) — set a timer's state. timeout, elapsed are in seconds, and supports fractional values (0.1 etc). Will trigger the node's on_timer function after timeout - elapsed seconds.
  • start(timeout) — start a timer, equivalent to set(timeout, 0)
  • stop() — stops the timer
  • get_timeout() — current timeout in seconds, if timeout is 0, timer is inactive
  • get_elapsed() — current elapsed time in seconds
  • is_started() — boolean state of timer, returns true if timer is started, otherwise false
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox