open.mp | GetTickCount
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

GetTickCount

Description

Returns the uptime of the actual server (not the SA-MP server) in milliseconds.

Examples

public OnPlayerConnect(playerid)
{
    new count = GetTickCount();
    //Rest of OnPlayerConnect
    printf("Time taken to execute OnPlayerConnect: %d", GetTickCount() - count);
    return 1;
}

Notes

tip

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.

warning

GetTickCount will cause problems on servers with uptime of over 24 days as GetTickCount will eventually warp past the integer size constraints. Check this package for a solution.

Related Functions

  • Tickcount: Get the uptime of the actual server.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub