GetTickCount
Jump to navigation
Jump to search
getTickCount
Returns the number of monotonic milliseconds elapsed in the current runtime.
Syntax
int getTickCount()
Parameters
This function does not accept parameters.
Returns
Returns a monotonic timestamp in milliseconds as an integer.
Examples
Measure how long an operation takes:
local startedAt = getTickCount()
-- Do some work here.
outputDebugString("Elapsed: " .. (getTickCount() - startedAt) .. " ms")
Notes
- Available in both client-side and server-side resource scripts.
- Use this value for elapsed-time calculations, not as a wall-clock date or time.