- Documentation
- Server functions
- getServerUptime
Function
getServerUptime
Returns the time since the server started, in milliseconds.
Syntax
int getServerUptime()Returns
Time in ms.
Example
addCommandHandler("uptime", function(player)
outputChatBox("Serwer dziala: " .. formatDuration(getServerUptime() / 1000), player)
end)
See also
getTickCountReturns the number of milliseconds since start (a clock that does not go back when the system time changes). For measuring intervals, subtract two values.formatDurationConverts a number of seconds into a readable form:"45s","3m 05s","1h 02m 05s". Fractions are truncated, negatives give"0s".