Updated February, 2005 for Windows XP
struct res, lowPart as ulong, highPart as long
'see if system has a high frequency counter
calldll #kernel32, "QueryPerformanceFrequency",_
res as struct, result as boolean
if result=0 then
print "System doesn't support hi-res counter."
end
else
freq=largeInt2Dec(res.lowPart.struct, res.highPart.struct)
calldll #kernel32, "QueryPerformanceCounter",_
res as struct, result as boolean
first=largeInt2Dec(res.lowPart.struct, res.highPart.struct)
calldll #kernel32, "QueryPerformanceCounter",_
res as struct, result as boolean
second=largeInt2Dec(res.lowPart.struct, res.highPart.struct)
print "Frequency in counts per second: ";freq
print "First value: ";first
print "Second value: ";second
print "Time (ticks) ellapsed: ";second-first
end if
end
'Stefan Pendl's function to create a decimal
'number from a large integer, using hex values
function largeInt2Dec(low, high)
lowHex$ = right$("0000" + dechex$(low), 4)
highHex$ = right$("0000" + dechex$(high), 4)
largeInt2Dec = hexdec(highHex$ + lowHex$)
end function