|
Post by smith legit on Jun 4, 2021 20:30:34 GMT
The sum of the individual times of my Macro is 900 milliseconds. It took me 113 seconds to run 100 iterations of the macro in a loop. Shouldn't it only take 90 seconds?
Context: The following Macro clicks a button that saves a file and appends the time to the filename. I want to save at least one file per second. Even though the Macro should be .9 seconds long, it took me an average of 1.13 seconds to save each file. I cannot reduce the "wait" time on line 3 because I need to wait for the window to open. Any suggestions? Thanks!
1 | 212 | 307 | 10 | Left Click Down
2 | 212 | 307 | 10 | Left Click Release
3 | RUN ACTION | | | | WAIT SECONDS | .6
4 | 376 | 420 | 10 | Keypress %STRING1% %TIME_H% %TIME_M% %TIME_S% %TIME_MS%
6 | 721 | 759 | 10 | Left Click Down
7 | 721 | 759 | 10 | Left Click Release
8 | RUN ACTION | | | | WAIT SECONDS | .25
|
|
|
Post by philranger on Jun 5, 2021 19:23:28 GMT
I think that time is quite approximative in MMM, especially time to loop.
|
|
|
Post by Steve on Jun 5, 2021 20:37:26 GMT
Hi Smith, The short answer is no.
The total running time is the MMM event wait time + Mini Mouse Macro event execution time + Windows event execution time. Lets take your first two action for example: 1 | 212 | 307 | 10 | Left Click Down 2 | 212 | 307 | 10 | Left Click Release The event wait time here is the 10ms timer that executes prior to the command occurring. The Mini Mouse Macro event execution time is the time that the app takes to process and pass the command to Windows. This is a very small time, but still a time. The Windows execution time is the time Windows takes to process the event. This takes as long as the operating system needs and can be effected by other operating system events. I do have some suggestions for your macro: 1. The first one is to abandon the old 'three pipe' syntax. This '| | |' is deprecated. It still works but one day I might rip that code out and it will stop working. 2. Your use of WAIT SECONDS | .6 is better to be WAIT MILLISECONDS | 600. It will save MMM from having to do any conversion and it's just cleaner for the app. 3. the 'Left Click Down/Up' can be replaced by a single ' Left Click' if you don't intend to do any mouse dragging whilst the mouse is down. Its faster this way and saves on execution time. 4. You mention you "need to wait for the window to open.", MMM has some conditions to detect and and wait for specific windows to open. Have a look at these for help on Window detection: www.turnssoft.com/conditions.html#windowtitlewww.turnssoft.com/conditions.html#selectwindowbynameminimousemacro.proboards.com/thread/351/pop-windowminimousemacro.proboards.com/board/3/help?q=select+windowThis is how I would format your macro: 1 | 212 | 307 | 10 | Left Click 2 | RUN ACTION | WAIT MILLISECONDS | 600 3 | 376 | 420 | 10 | Keypress %STRING1% %TIME_H% %TIME_M% %TIME_S% %TIME_MS% 4 | 721 | 759 | 10 | Left Click 5 | RUN ACTION | WAIT MILLISECONDS | 250 Hope this helps.
|
|
|
Post by smith legit on Jul 12, 2021 19:08:15 GMT
This was really helpful. Thank you!
|
|
trey
Junior Member
Posts: 12
|
Post by trey on Jul 14, 2021 14:28:24 GMT
SteveRelevant additional question without needing to start a new thread: Is it possible to do math operations with %date% and %time%? My use case is that at the start of my macro sequence I want to define %start_time% and at the end I want to generate a report file that includes some notion of %exec_time% where %exec_time% = %time% - %start_time%
|
|
|
Post by Steve on Jul 14, 2021 23:18:53 GMT
Steve Is it possible to do math operations with %date% and %time%? My use case is that at the start of my macro sequence I want to define %start_time% and at the end I want to generate a report file that includes some notion of %exec_time% where %exec_time% = %time% - %start_time%
A good way to calculate the running time is to use the internal %time_macro% variables. We don't have the option in MMM to evaluate full time values like in your example. To evaluate time you would need to break it down into H M S and evaluate based on the integer value. The %time_macro% variables make this easier if all you want the total macro playback time.
|
|