Timer.Simple

From Nomad DB
Revision as of 11:19, 3 August 2020 by Jan (talk | contribs) (Created page with "Creates a simple unnamed Timer which is executed once after the time has elapsed. == Syntax == <syntaxhighlight lang="lua"> timer.Simple(duration, callback[, ...]) </syntaxhi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Creates a simple unnamed Timer which is executed once after the time has elapsed.

Syntax

timer.Simple(duration, callback[, ...])
  • duration: number (in seconds)
  • callback: function (to invoke after the timer elapsed)
  • [...]: varargs (any amount of parameters that should be passed to the callback)
    • function call: callback([...])
  • Returns: Timer instance (can be used with timer.Remove)

Example

timer.Simple(1, function()
	print("1 Second elapsed")
end)

Related Pages