how to get the running time of an application?

Class library usage, coding and language questions.
huixiao
Posts: 1
Joined: Thu Oct 27, 2011 10:56 am

how to get the running time of an application?

Post by huixiao » Thu Oct 27, 2011 11:13 am

hello,i want to get the running time of an application.For example ,i added an action of Run Application in a Module for running an exe,how can i get the running time of the exe? i need your help.best regards.

Code: Select all

Report.Log(ReportLevel.Info, "Application", "Run application with file name from variable $SolutionPath with arguments '' in normal mode.", new RecordItemIndex(1));
Host.Local.RunApplication(SolutionPath, "", "", false);//i wan to get the running time
Delay.Milliseconds(0);

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: how to get the running time of an application?

Post by Support Team » Thu Oct 27, 2011 11:54 am

Hi,
huixiao wrote:ow can i get the running time of the exe?
One possible solution would be to use the .Net Framework Stopwatch. Therefore please take a look to following link http://msdn.microsoft.com/en-us/library ... watch.aspx

Or if you want to know how long your test was running, please use the Duration of the Report.

Regards,
Peter
Ranorex Team
.
Image