[AccessD] Resolution of Time call

Gustav Brock gustav at cactus.dk
Tue Sep 27 09:30:55 CDT 2022


Hi Stuart

Yes, thanks, it is the seconds since midnight - I mixed it up with one of the API calls.

I've found that the Timer is more than adequate for timing queries and other potential long runs. And it is always at hand.

/gustav

-----Oprindelig meddelelse-----
Fra: AccessD <accessd-bounces+gustav=cactus.dk at databaseadvisors.com> På vegne af Stuart McLachlan
Sendt: 27. september 2022 16:16
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Emne: Re: [AccessD] Resolution of Time call

Hmm, Just dropped over to a PB application that plays around with timer resolution and re-ran the VBA function.  Now getting 1ms resolution on Timer

Seconds       DIfference    Iterations
 616.828979492188            0.0009765625                2230 
 616.833984375               0.0009765625                9764 
 616.838989257813            0.0009765625                15661 
 616.843017578125            0.00103759765625            16176 
 616.846984863281            0.0009765625                19115 
 616.851013183594            0.00103759765625            23602 
 616.85498046875             0.0009765625                24125 
 616.859008789063            0.00103759765625            27531 
 616.862976074219            0.0009765625                34077 
 616.867004394531            0.0009765625                40258 

Note: that it's just past midnight here so Timer has reset, disproving Gustav's earler statement that:
"It returns seconds since machine launch" 

It actually returns seconds since midnight, so you need to be careful with using it to measre times that roll over to the next day


On 27 Sep 2022 at 23:59, Stuart McLachlan wrote:

> Resolution these days is a lot higher than 1/18 of a second.
> 
> Testing on my laptop, it's more like 8 milliseconds.
> (If you need finer resolution, you can get 100 nanosecond resolution
> using API calls.)
> 
> Here's a demo of my resolution (7.8125 milliseconds)
> ...

> Seconds       DIfference    Iterations
>  85405.8515625               0.0078125     53373 
>  85405.859375                0.0078125     74612 
>  85405.8671875               0.0078125     104048 
>  85405.875     0.0078125     131782 
>  85405.8828125               0.0078125     149624 
>  85405.890625                0.0078125     182648 
>  85405.8984375               0.0078125     214853 
>  85405.90625   0.0078125     245402 
>  85405.9140625               0.0078125     275054 
>  85405.921875                0.0078125     301396


-- 


More information about the AccessD mailing list