GetTickCount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


==Syntax==
==Syntax==
int [[getTickCount]] ()
<syntaxhighlight lang="lua">getTickCount ()</syntaxhighlight>


==Required Arguments==
==Required Arguments==
Line 10: Line 10:


==Example==
==Example==
GetTickStart = [[getTickCount]] ( )
<syntaxhighlight lang="lua">GetTickStart = getTickCount ( )
//Insert custom code here...
//Insert custom code here...
GetTickEnd = [[getTickCount]] ( )
GetTickEnd = getTickCount ( )
[[serverChat]] ( "Time elapsed:", GetTickEnd - GetTickStart )
serverChat ( "Time elapsed:", GetTickEnd - GetTickStart )</syntaxhighlight>

Revision as of 03:20, 18 May 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

getTickCount ()

Required Arguments

This function has no arguments.

Example

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