GetTickCount: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 26: | Line 26: | ||
* Use this value for elapsed-time calculations, not as a wall-clock date or time. | * Use this value for elapsed-time calculations, not as a wall-clock date or time. | ||
[[Category:Lua Functions]] | |||
[[Category:Shared Functions]] | [[Category:Shared Functions]] | ||
[[Category:Utility Functions]] | [[Category:Utility Functions]] | ||
[[Category:Timer Functions]] | [[Category:Timer Functions]] | ||
Latest revision as of 09:53, 15 August 2026
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.