[AccessD] Timer function, fraction of seconds

Gustav Brock Gustav at cactus.dk
Mon Feb 14 10:52:11 CST 2005


Hi Marty

It was out of curiosity only; sometimes you find something useful in
Access.

And sometimes you may need a resolution finer than 1 second, and with
the simple Timer function it is there with an accuracy of 1/64 second
(so it seems) with no API calls or nothing else.

/gustav

>>> martyconnelly at shaw.ca 14-02-2005 16:51:02 >>>
Not sure how fine you want to time, here are a couple of finer methods

--In the Declarations section--
' GetTickCount  returns the number of milliseconds that Windows has
been 
running.
Declare Function GetTickCount& Lib "kernel32" ()

---from the DebugWindow---
? "It has been " & gettickcount() & " milliseconds since Windows
started"
It has been 61604492 milliseconds since Windows started
? "It has been " & gettickcount() & " milliseconds since Windows
started"
It has been 61610871 milliseconds since Windows started
 
or these functions to get clock frequency and ticks
I have a class to do these somewhere

' determine if system has Performance Counter and get its frequency
' returns ticks/sec (1.193.180 on my machine PII 350)

Private Declare Function QueryPerformanceCounter Lib "kernel32" ( _
    lpPerformanceCount As Currency) As Long

Private Declare Function QueryPerformanceFrequency Lib "kernel32" ( _
    lpFrequency As Currency) As Long


Gustav Brock wrote:

>Hi all
>
>Has anyone used this?
>It is a classic in the callback function example but I don't recall
any
>reference to it.
>
>It seems to return seconds from midnight as well as a fraction of a
>second with a resolution of about 1/60 second. Thus it could be used
>where you need a resolution of less than one second.




More information about the AccessD mailing list