GetTickCount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 11: Line 11:
==Example==
==Example==
  GetTickStart = [[GetTickCount]] ( )
  GetTickStart = [[GetTickCount]] ( )
  //Do some other stuff here
  //Insert custom code here...
  GetTickEnd = [[GetTickCount]] ( )
  GetTickEnd = [[GetTickCount]] ( )
  [[serverchat]] ( "Time elapsed:", GetTickEnd - GetTickStart )
  [[serverchat]] ( "Time elapsed:", GetTickEnd - GetTickStart )

Revision as of 11:01, 26 March 2006

Description

This function returns amount of time that your system has been running in milliseconds. By comparing two values of GetTickCount, you can determine how much time has passed (in milliseconds) between two events. This could be used to determine how efficient your code is, or to time how long a player takes to complete a task.

Syntax

int getTickCount ()

Required Arguments

This function has no arguments.

Example

GetTickStart = GetTickCount ( )
//Insert custom code here...
GetTickEnd = GetTickCount ( )
serverchat ( "Time elapsed:", GetTickEnd - GetTickStart )