Jump to content
Macro Express Forums

Timed Delays versus normal delays


Recommended Posts

The help file differentiates the timed delay as as sort of putting MEP in a sleep mode. I can understand that but I can't understand the intention or the possible applications. Can someone please explain to me where and when one should use timed delay mode?

 

I will not go into it here but I recently discovered the mechanism of the two delays are different, can someone please describe to me how they differ?

Link to comment
Share on other sites

A normal delay uses a loop. Each iteration through the loop uses CPU cycles. The Wait for delay uses Windows to put the process to sleep for a specific amount of time. While asleep Macro Express uses no CPU cycles.

 

You can terminate a macro in the middle of a normal Delay but you cannot terminate a macro in the middle of a Wait for delay.

 

On a shared system such as Windows Terminal Services, Citrix, XenApp or virtual sessions such as Virtual PC or VMware these extra CPU cycles can affect other users of the same hardware. When that is the case we recommend using the Wait for delay instead of the normal Delay.

Link to comment
Share on other sites

Good explanation but I'm still a little confused. I had not mentioned the Wait for Time to Elapse but was rather speaking of the two options in the normal Delay command, timed and not timed. Are you suggesting that the Wait for Time to Elapse essentially the same thing as a timed Delay? I'll assume for the rest of this message it is.

 

Next I performed a simple test and wanted confirmation of my findings. I created two macros, one with a loop that kept updating a text box every second and the other that had a simple timed delay. I started the first and then ran the second while it was still running and the first never missed a beat. You said "While asleep Macro Express uses no CPU cycles" and I think that needs additional qualification to isolate it to that macro. Is it safe to say "While asleep Macro Express uses no CPU cycles for that macro"?

 

When choosing between the two is it simply a matter of weighing the additional load on the CPU versus the ability to halt? IE one should use the normal delay until the CPU load becomes a factor and then consider the timed delay. Is this essentially what it comes down to? Then again if we're talking about fractions of a second does one really care if one can't halt the macro.

 

I feel like someone has given me access to a backhoe and a trencher and told me to dig a ditch. I know how each works but that still doesn't tell me which is the best to employ.

Link to comment
Share on other sites

A normal delay uses a loop. Each iteration through the loop uses CPU cycles. The Wait for delay uses Windows to put the process to sleep for a specific amount of time. While asleep Macro Express uses no CPU cycles.

 

You can terminate a macro in the middle of a normal Delay but you cannot terminate a macro in the middle of a Wait for delay.

 

On a shared system such as Windows Terminal Services, Citrix, XenApp or virtual sessions such as Virtual PC or VMware these extra CPU cycles can affect other users of the same hardware. When that is the case we recommend using the Wait for delay instead of the normal Delay.

 

When using Macro Express in tandem with RAM intensive programs (say, Dragon NaturallySpeaking), is it preferable to use a "wait for delay" instead of a normal "delay?"

 

Is there a threshold (say, 25 ms, 1000 ms, 3000 ms, etc.) beyond which one can notice performance penalties from using one wait command over the other?

Link to comment
Share on other sites

Is it safe to say "While asleep Macro Express uses no CPU cycles for that macro"?

Yes.

 

When choosing between the two is it simply a matter of weighing the additional load on the CPU versus the ability to halt?

Yes.

Link to comment
Share on other sites

When using Macro Express in tandem with RAM intensive programs (say, Dragon NaturallySpeaking), is it preferable to use a "wait for delay" instead of a normal "delay?"

 

Is there a threshold (say, 25 ms, 1000 ms, 3000 ms, etc.) beyond which one can notice performance penalties from using one wait command over the other?

Each program and system are different. It is impossible for us to test every computer and program combination. We make no recommendations about when to use one or the other. It is up to you to try it.

Link to comment
Share on other sites

Thanks for the quick response. One final question: Does Wait for Time to Elapse use the same zero CPU method as timed Delay? IE is Wait for Time to Elapse essentially a longer period version of timed Delay?

Link to comment
Share on other sites

Thanks for the quick response. One final question: Does Wait for Time to Elapse use the same zero CPU method as timed Delay? IE is Wait for Time to Elapse essentially a longer period version of timed Delay?

Wait for Time to Elapse and Delay: 0 milliseconds, without ability to halt work the same way.

Link to comment
Share on other sites

Wait for Time to Elapse and Delay: 0 milliseconds, without ability to halt work the same way.

 

There is also the "Timed Delay in Seconds" and "Timed Delay in Milliseconds" commands, which apparently are easy on CPU and cannot be halted.

Link to comment
Share on other sites

There is also the "Timed Delay in Seconds" and "Timed Delay in Milliseconds" commands, which apparently are easy on CPU and cannot be halted.
This is what I was asking about. Delay versus Timed Delay.
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...