|
-
Mar 22nd, 2002, 09:05 PM
#1
Thread Starter
Addicted Member
QueryPerfCounter -> Isn't this the easier way?
Hmmm.
I have been using the Performance Counter for some time now for various things. Anyhow, when I originally researched into using it, I found a lot of code that suggested making the call something like this:
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Any) As Long
Type LARGE_INTEGER
lowpart As Long
highpart As Long
End Type
Dim locLARGE_INTEGER As LARGE_INTEGER
Dim locPerfCount As Currency
CALL QueryPerformanceCounter(locLARGE_INTEGER)
CopyMemory locPerfCount, locLARGE_INTEGER, 8
...
I agree that the Currency data type seems like the logical place to keep the returned value, however, recently I thought that the above code could be reduced; As follows:
Dim locPerfCount As Currency
CALL QueryPerformanceCounter(locPerfCount)
...
I am a little unclear as to why anyone would want to do it the longer way and why most people seem to be doing it that way?
((( Please let's not debate my Declare's. That's the way I like them. )))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|