GetTickCount
Description:
Function GetTickCount returns the uptime of the actual server (not the SA-MP server) in milliseconds.
GetTickCount will cause problems on servers with uptime of over 24 days as GetTickCount will eventually warp past the integer size constraints. However using This function fixes the problem. |
One common use for GetTickCount is for benchmarking. It can be used to calculate how much time some code takes to execute. See below for an example. |
Parameters:
(This function has no parameters.)
Return Values:
Uptime of the actual server (not the SA-MP server).
Examples:
public OnPlayerConnect(playerid) { new count = GetTickCount(); //Rest of OnPlayerConnect printf("Time taken to execute OnPlayerConnect: %d", GetTickCount() - count); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- tickcount: Get the uptime of the actual server.
- GetTickDiff: Calculate the time elapsed between the two calls GetTickCount(), given the possibility of overflow passed values.