Timer

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
xav
Newbie
Posts: 5
Joined: Fri Nov 01, 2013 8:20 pm

Timer

Post by xav » Fri Nov 01, 2013 8:28 pm

Dear Forum Members,

I'm facing following problem and was not able to find solution on forum and in FAQ

I have something like this

Code: Select all

Let>WW_TIMEOUT=9999
WaitWindowOpen>Program - Ready Status
WaitWindowOpen>Program - Not Ready Status
i need to count how many minutes + seconds passed between program changes it's status

Also this action will be repeated several times, will need to add to get total time.

As result i need to obtain
StayedOnline1="42 min 13 sec"
StayedOnline2= 27 min 54 sec"
TotalTimeOnline="70 min 07 sec"



Please help :?:

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Nov 04, 2013 12:53 pm

The Timer function is the way to go.
Timer>result

Returns the number of milliseconds that have elapsed since the script was started.

Example:

Timer>startTime
..
.. do something here
..
Timer>endTime
Let>elapsed_seconds={(%endTime%-%startTime%)/1000}
MessageModal>Seconds elapsed: %elapsed_seconds%
I've posted a stopwatch example in the Scripts and Tips forum that is using the Timer function here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts