View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bruce Bolio Bruce Bolio is offline
external usenet poster
 
Posts: 6
Default Get Milliseconds in a timestamp

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