GetTickCount

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function returns the uptime of the host in milliseconds. This function is useful for measuring times, especially small intervals. Note that for hosts which have been online more than 24 days, the tick count will return back to 0.

Syntax

  1. int GetTickCount()

Arguments

  • none

Example

This example tells the player how long the host pc has been on when they type '/hoston'

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "hoston" )
  5. {
  6. MessagePlayer( "The host pc has been online for " + floor( GetTickCount() / 60000 ) + " minutes.", player );
  7. }
  8. }
  9.  

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox