Timer

The way almost all the code base depend on when it gets to timers

Initialise

In order to initialise, it is as simple as this:

local deathTimer = Timer.New()

-- This also support the argument startTime
-- which is used if you would like to play a little with the time
Timer.New(-10000) -- Starts a timer 10 seconds ago
Timer.New(2000) -- Starts a timer in 2 seconds

Time Elapsed?

Returns a value in ms

print(deathTimer.elapsed()) -- 12387

Restart Timer?

deathTimer.restart() -- This also supports the argument startTime like above

-- You can also re-set the value
deathTimer = Timer.New()

Last updated