The unit is in seconds.
A way to print floats in a console application:
( Possibly there are routines for this in the masm lib? )
includelib \masm32\lib\msvcrt.lib
sprintf proto C :vararg ; from msvcrt.lib
TEXT_ MACRO your_text:VARARG
LOCAL text_string
.data
text_string db your_text,0
.code
EXITM <addr text_string>
ENDM
.data?
szString_buffer db 512 dup (?)
fp8value real8 ?
.code
align 4
StdOut proc lpszText:DWORD
LOCAL hOutPut :DWORD
LOCAL bWritten :DWORD
LOCAL sl :DWORD
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov hOutPut, eax
invoke lstrlen,lpszText
mov sl, eax
invoke WriteFile,hOutPut,lpszText,sl,ADDR bWritten,NULL
mov eax, bWritten
ret
StdOut endp
PrintTimer proc
fld Timers.Timer1 ; Real4 format -> convert to real8 format
fstp fp8value ; save as Real8 format for use with sprintf function
invoke sprintf,addr szString_buffer,TEXT_("Timer: %0.06f",13,10),fp8value
invoke StdOut,addr szString_buffer
PrintTimer endp
TimeBeginTime is just wrapper code, better deal directly with,
QueryPerformanceFrequency and QueryPerformanceCounter
NtQueryTimerResolution
NtSetTimerResolution
NtDelayExecution ( 500 microseconds delay )
No, I use Sleep with the standard granularity for normal occasions
But for threaded interrupt timers ( 100 nanosecond units ) I use the 500 microseconds Sleep version to do fast synchronizations.
Which I will use in the vertical blank routine I'm writing ( hope to show it next week or a week later )