Was wondering has anyone use or know how to use the gettickcount api
Trying to display it in a msg box.
Trying to display it in a msg box.
Invoke GetTickCount
That's it, the system up-time in milliseconds (limited by the system timer res.) is placed in EAX. You can convert it to a string using dw2a.
Donkey
That's it, the system up-time in milliseconds (limited by the system timer res.) is placed in EAX. You can convert it to a string using dw2a.
Donkey
From the Win32 Programmer's Reference:
1) you call the function at the start of the interval to read the "time" such as if you were looking at your watch, and keep that returned value in memory;
2) you call the function once more at the end of the interval and subtract the start time from the returned value to get the elapsed time of the interval.
You can then do whatever you need with that value which is in milli-seconds.
I find that timer quite sufficient for animations.
Raymond
Return Values
If the function succeeds, the return value is the number of milliseconds that have elapsed since Windows was started.
If you want to use the function as a timer for a given interval,
If the function succeeds, the return value is the number of milliseconds that have elapsed since Windows was started.
1) you call the function at the start of the interval to read the "time" such as if you were looking at your watch, and keep that returned value in memory;
2) you call the function once more at the end of the interval and subtract the start time from the returned value to get the elapsed time of the interval.
You can then do whatever you need with that value which is in milli-seconds.
I find that timer quite sufficient for animations.
Raymond
thx Donkey but what is dw2a. this is how I it work for me
start:
invoke GetTickCount
invoke wsprintf, addr buftime,addr szformat,eax
invoke MessageBox,0,addr buftime,addr mytitle,MB_OK
invoke ExitProcess,0
end start
does dw2a convert it to a more readable format
start:
invoke GetTickCount
invoke wsprintf, addr buftime,addr szformat,eax
invoke MessageBox,0,addr buftime,addr mytitle,MB_OK
invoke ExitProcess,0
end start
does dw2a convert it to a more readable format
dw2a is a library function in the MASM32 library. It works like this :
invoke dw2a,eax,ADDR buftime
It will convert a DWORD value to an ascii string and place it in the buffer you specify. It is a little faster than wsprintf in my opinion and needs no format strings. There are many useful functions in the masm32 library, you will find them documented in the \Masm32\Help\MASMLIB.HLP help file. You must include the following lines to use the library functions:
include \masm32\include\masm32.inc
includelib \masm32\lib\masm32.lib
invoke dw2a,eax,ADDR buftime
It will convert a DWORD value to an ascii string and place it in the buffer you specify. It is a little faster than wsprintf in my opinion and needs no format strings. There are many useful functions in the masm32 library, you will find them documented in the \Masm32\Help\MASMLIB.HLP help file. You must include the following lines to use the library functions:
include \masm32\include\masm32.inc
includelib \masm32\lib\masm32.lib
Well donkey U were right it works dw2a. Guess I better read the masm32 lib hlp file
Sorry I haven't coded anything useful yet! Hopefully some I will
Sorry I haven't coded anything useful yet! Hopefully some I will