PDA

View Full Version : Solved: Timer for code execution



cavemonkey
06-13-2007, 10:13 PM
Hi

I'm just wondering if anyone knows of any code that can record the amt of time needed to execute a code?

I need to show my superviosr that the new code I wrote is faster than the older one.

Thanks

acw
06-13-2007, 11:07 PM
Hi

At the start of your code put in a variable to record the starting time. At the end, you can then subtract that time from the current time and show the elapsed time


starttime = now()
.......
msgbox format(now()-starttime,"hh:mm:ss")


If you like, you could put the result to a cell on the sheet, and format the cell to be in time mode.

HTH

Tony

cavemonkey
06-13-2007, 11:47 PM
Ic thanks a lot.