Jump to content

Log duration of script execution


Recommended Posts

Hello,

I'm a new user to AutoIT. I am attempting to write some simple synthetic benchmarks for a Windows environment. I have a script that I have written that simply opens Microsoft Word, types some text, and then saves the file and exits. I'd like to record the duration of the execution so I can track it on each run as additional background processes are added to the workstation. 

Are there any recommendations for this? Ideally I'd record the duration time to a CSV on a network share for example. 

Thank you,

Richard

 

Link to comment
Share on other sites

  • Moderators

@RichardMost welcome to the forum. Look at TimerInit() and TimerDiff() in the help file. The example shows you just how to start a timer at the top of your script. Then when you're done, you can get total runtime. You can either use FileWriteLine or the _Excel_ functions to output the data as you would like.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Just now, JLogan3o13 said:

@RichardMost welcome to the forum. Look at TimerInit() and TimerDiff() in the help file. The example shows you just how to start a timer at the top of your script. Then when you're done, you can get total runtime. You can either use FileWriteLine or the _Excel_ functions to output the data as you would like.

Thanks for the quick heads up! I'll take a peek at those functions and fiddle with it! 

Link to comment
Share on other sites

25 minutes ago, JLogan3o13 said:

@RichardMost welcome to the forum. Look at TimerInit() and TimerDiff() in the help file. The example shows you just how to start a timer at the top of your script. Then when you're done, you can get total runtime. You can either use FileWriteLine or the _Excel_ functions to output the data as you would like.

Thanks! This accomplishes exactly what I wanted to do. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...