How to count the timeout of a command ?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
mezii
Newbie
Posts: 2
Joined: Wed Aug 05, 2015 4:38 am

How to count the timeout of a command ?

Post by mezii » Wed Aug 05, 2015 4:43 am

Hi, everyone. I have 4 module which was built to exe. The things i need now is count how much time of one module works, if it works more 40 sec, we will repeat all the process of 4 module.

For example: i have module A, B, C , D

Each module can run 10-20 sec (but in the case any module meet problems, it will run more 40 sec)

I run A -> B -> C -> D
Assume that I am running at B module and it meet problems , it run more 40 sec. All the process will be stopped and repeat A->B->C->D again/

I cannot find any threads on this forums which is mentioned about it ? Hope you guys can help me figure out this problem !!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to count the timeout of a command ?

Post by Marcus Tettmar » Wed Aug 05, 2015 11:37 am

I think to do this you would need another compiled macro running at the same time which could be launched asynchronously with the Run command. This would set up a loop which checks the existence of the compiled macro .exe you want to monitor (using ProcessExists>) and checks the elapsed time (using Timer>) and decides what to do - it could KillProcess and then launch something else for example.

So in other words you need a controlling macro which runs the macro you want to monitor, it can start that macro .exe asynchronously and then monitor how long it is running for ....

Does that make sense?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mezii
Newbie
Posts: 2
Joined: Wed Aug 05, 2015 4:38 am

Re: How to count the timeout of a command ?

Post by mezii » Sat Aug 08, 2015 9:28 am

Thank you Marcus, It worked perfect. But it gave me a little bit trying about Timer.
After timer is divided 1000 as this:

Let>clip=(%endTime%-%startTime%)/1000

It will return to a string value, not interchangeable to integer when you make a comparison because the value will be returned at "xxx,xxx" not "xxx.xxx"

And have you developed "Objective Oriented" in Macro Scheduler ? I wanna use Class to make everything to simpler and easy to access ?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to count the timeout of a command ?

Post by Marcus Tettmar » Mon Aug 10, 2015 9:48 am

That's bad syntax. You can do:

Let>clip={(%endTime%-%startTime%)/1000}

Or, break it apart:

Let>clip=endTime-startTime
Let>clip=clip/1000
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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