|
Post by Rambo-X on Dec 15, 2020 2:04:02 GMT
Good Day Dear All,
I have a requirement to know a time comparison between the Macro's I run to help me make them more efficient.
My exact requirement is that I want to get the run time of my current Macro ( Generally found in the Bottom Right Hand Corner in the App ) ex : 1:52:33:281 ( H:MM:SS:MS )
And then a message box to appear stating,
01. The current Run time of the Macro I ran. 02. That time multiplied by 100 03. That time multiplied by 200
so on until 500 up to 6 Lines.
Plus let's say I change my mind to multiply the Point No. 02 by 10 then how could I assign it to change from 100 to 10 etc. Is that Possible?
Then I would know how long would I need to run a script and so on.
Thank you very much for this Wonderful place.
Stay safe and Tc.
|
|
|
Post by zeak on Dec 15, 2020 6:27:53 GMT
Hi Rambox, I believe what you are looking for is %TIME_MACRO%. Example below. 1 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL1%::%TIME_MACRO% 2 | RUN ACTION | MESSAGE PROMPT | %DECIMAL1%::Time::0
|
|
|
Post by Rambo-X on Dec 15, 2020 17:45:08 GMT
Hello Zeak,
Yeah but a little bit more detailed than that.
Like I don't want the Macro to stop in the Middle.
Let me take a small example.
Lets say My Macro is 10 lines long. Doing some basic stuff clicks and all, yeah. then at the end it stops.
That's when I need the message Box.
This message Box needs me to give me information line by line. ( wouldn't mind even if it's message Box after message Box at the end either ) But what should they contain,
Box 1 / Line 1 : The Entire Run time of the 10 Lines Box 2 / Line 2 : ( Now this should get generated after a calculation, because physically the coding lines aren't available ) The Entire Run time "IF" it was 100 Lines ( Like if I had copy pasted these 10 lines one after the other 10 times, it would be 100 lines ) Box 3 / Line 3 : ( Now this should get generated after a calculation, because physically the coding lines aren't available ) The Entire Run time "IF" it was 200 Lines ( Like if I had copy pasted these 10 lines one after the other 20 times, it would be 200 lines )
So on until 500.
Is this possible Brother?
|
|
|
Post by Steve on Dec 18, 2020 4:08:25 GMT
Hi Rambo-X Is this possible, well...sorta but not really with MMM how it is currently. zeak pointed out the %TIME_MACRO% variable. This is ok for getting the running time but thats about it. It not great for doing any logic around it. There are other TIME variables: %TIME% - The current time in full %TIME_MS% - The current ms %TIME_S% - the current second %TIME_M% - the current minute %TIME_H% - the current hour I'd suggest doing you time logic outside of MMM. Probs a simple bash script could handle it, or powershell. Then feed this value back in to MMM using INPUT FROM FILE ( www.turnssoft.com/conditions.html#inputfromfile).
|
|
|
Post by Steve on Dec 18, 2020 20:05:30 GMT
I've expanded the internal TIME_MACRO variable to be more granular for time calculations.
The %TIME_MACRO% internal variable is now expanded to include granular total output: %TIME_MACRO_H% - The total running time in hours %TIME_MACRO_M% - The total running time in minutes %TIME_MACRO_S% - The total running time in seconds %TIME_MACRO_MS% - The total running time in milliseconds The new variables will allow for logic like this: 10 | IF | INTEGER VARIABLE | %TIME_MACRO_M% | LESS THAN | 5 | GOTO MACRO LINE | PROCESS | ELSE | 10 | RUN ACTION | GOTO MACRO LINE | STAGE The new variables will also make it easier to do some math operations against the time: 1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::%TIME_MACRO_M%::*100 Thank you Rambo-X for the idea.
|
|
|
Post by Rambo-X on Dec 20, 2020 22:42:40 GMT
|
|