Skip to main content

System

Quick Reference

NameTypeDescription
GetTimeSharedReturns a monotonic clock in milliseconds.

Shared Functions

GetTime

Returns the time in milliseconds from a clock that only ever moves forward. It is the clock the threads and timers run on, so it is the right one for measuring how long something took or for checking whether a pause is over.

int milliseconds = System.GetTime()

info

The value has no meaning on its own; only the difference between two readings does. It is not the time of day and not related to the value on another machine. For the date and time use the language's own functions (os.time, Date).

Example:

local start = System.GetTime()

local rows = Database.Select("SELECT * FROM users", {})

Console.Log("Query took " .. (System.GetTime() - start) .. " ms.")