GetTickCount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Needs_Checking|Unspecified}}
__NOTOC__
__NOTOC__
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.
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.
Line 19: Line 21:
==See Also==
==See Also==
{{Utility functions}}
{{Utility functions}}
[[Category:Needs Checking]]

Revision as of 04:10, 10 September 2006

Dialog-information.png This article needs checking.

Reason(s): Unspecified


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 ()

Returns

Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around (needs confirming when and what the result is).

Example

This example shows how you can benchmark some code to see how long it takes to run.

getTickStart = getTickCount ( )

-- Insert your code here

getTickEnd = getTickCount ( )
outputChatBox ( "Time elapsed: " .. GetTickEnd - GetTickStart .. " milliseconds" )

See Also