View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Get Milliseconds in a timestamp

Bruce,

Microsoft appears to disagree. They say the resolution of the Timer, now
and Time are about 1 Second. They show other ways to time code:

http://support.microsoft.com/kb/172338
How To Use QueryPerformanceCounter to Time Code

--
Regards,
Tom Ogilvy


"Bruce Bolio" wrote:

You can get sickening accuracy.

The Time() function returns the current time.

If you do timeTaken = endTime - startTime, you get a result returned that
goes way past milliseconds.
--
Thanks,

Bruce Bolio


"Dave" wrote:

I'm trying to figure out how long my macro is taking to run, and I want it as
accurate as possible... it would be great if I could get it down to
millisecond precision, is this possible?

Something like:

function test()
startTime = Now()

...
(function code)
...

endTime = Now()

timeTaken = endTime - startTime
test = timeTaken
end function