Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro running time

I want to check the time (in seconds) which my macro takes to run.
what code can be used.

thanks
pradip
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro running time

AT the start

nTimer = Timer
... your code
Debug.Print Timer - nTimer

will give you an indicative answer, it is not absolute because there is so
much else going on.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pradip Jain" wrote in message
...
I want to check the time (in seconds) which my macro takes to run.
what code can be used.

thanks
pradip



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro running time

Sub TimeMyMacro()
Dim sngStart as Single, sngEnd as Single
sngStart = Timer
' call you macro
sngEnd = Timer

msgbox "It took " & format(sngEnd - sngStart,"0") & " seconds"
End Sub

The resolution of Timer is about 1 second.

For more resolution, see the techniques in this article.

http://support.microsoft.com/support.../q172/3/38.asp
HOWTO: Use QueryPerformanceCounter to Time Code

--
Regards,
Tom Ogilvy
"Pradip Jain" wrote in message
...
I want to check the time (in seconds) which my macro takes to run.
what code can be used.

thanks
pradip



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a macro based on the time WNYC Excel Discussion (Misc queries) 1 March 22nd 10 09:45 PM
Running a macro at a specified time The Bobka Excel Discussion (Misc queries) 1 June 30th 05 05:25 PM
Running a macro at a certain time Tam Excel Discussion (Misc queries) 3 March 2nd 05 02:50 PM
All time running macro gocush[_29_] Excel Programming 2 January 12th 05 03:19 PM
Running a macro at a certain time Dave Peterson[_3_] Excel Programming 0 October 17th 03 01:49 AM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"