[Snippet] GetTickCount

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
922
Likes
4
Points
68
#1
Function useful for measuring time (cleo timers are not accurate when the game is lagging, for example when the car speed is very high).
It returns time since PC was started (in milliseconds).

Code:
//0AB1: call_scm_func @GetTickCount 0 _returnedTickCount [email protected]
:GetTickCount
0AA2: [email protected] = load_library "kernel32.dll" // IF and SET
[email protected] = 0
   if 0AA4: [email protected] = get_proc_address "GetTickCount" library [email protected] // http://www.geoffchappell.com/studies/windows/win32/kernel32/api/index.htm   https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
   then    
   0AA7: call_function [email protected] num_params 0 pop 0 [email protected]    
   end
0AA3: free_library [email protected]
0AB2: ret 1 [email protected]
 
Top