Jump to content
Macro Express Forums

Delay Vs Wait Time Delay


Lars_Sandberg

Recommended Posts

Hi, I found out that there seem to be an advantage for using Wait Time Delay instead of normal Delay, since Wait Time Delay don't require the extensive use of CPU during the delay, as stated in the help file. The Macros can the only be stopped, when the Wait Time Delay is over and the next line of code is executed.

The interesting thing is that Wait Time Delay also accept milliseconds as below: Wait Time Delay 0,04 Seconds

For some applications my macros now works more smooth during the Wait Time Delay, than when I used normal delays.

 

What is your opinion and experience about that?

 

regards Lars

Link to comment
Share on other sites

I've always avoided using the Wait Time Delay command becuase the Help section said the macro cannot be stopped during this phase:

 

Note: This command suspends Macro Express for the amount of time specified. During this time the macro cannot be terminated by pressing the Scroll Lock+Pause keys or by right clicking on the "Running Man" icon in the system tray.

 

While reading your post I was thinking of a few of macros that would really benefit from "virtually no CPU cycles" benefit of the command of long delays. I just don't like the idea of not being able to stop the macro. Then I had an idea...

 

Instead of a single 60 second Wait Time Delay, I created a 60 count Repeat that started with a 1 second Wait Time Delay followed by a 0.01 Delay command.

Repeat Start (Repeat 60 times)
 Wait Time Delay 1 Seconds
 Delay 0.01 Seconds
Repeat End

This code had the following benefits as opposed to the single 60 second Wait Time Delay:

  • The macro could be exited during the 60 second delay. (Right clicking on the "Running Man" icon was 100% effective while the Hot Key method was less reliable.
  • Task Manager showed a CPU Usage of 50% during the single 60 second Wait Time Delay, while the above code had a 1% CPU Usage during it's 60 second delay.

Now I have some macros to hunt down and improve. Later... ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...