Jump to content
Macro Express Forums

Delay consuming high CPU?


Recommended Posts

 

I've used the ultra simple macro below for years. (Usually to remind me - engrossed on PC - to remove tea bag from freshly poured mug of tea.) But I've just noticed this morning that it was consuming over 12% of my CPU. Must be the Delay command. Perhaps since recent update to version 6.4.0.1? Cannot pursue until I get back later home later but meanwhile wonder if one of you could try it please?
Tuesday 18 October 2022, 0928.


Variable Set Integer %nMinutes%: Prompt
Delay: %nDelay% seconds
Variable Modify Integer: %nDelay% = %nMinutes% * 60
Delay: %nDelay% seconds
Sound File: Alarm-Classic.wav
Text Box Display: 


<VARIABLE SET INTEGER Option="\x01" Destination="%nMinutes%" Prompt="Enter the time delay required in minutes before the alarm should be heard." Mask="FALSE" OnTop="TRUE" Left="Center" Top="Center" Monitor="0"/>
<DELAY Flags="\x01" Time="%nDelay%"/>
<VARIABLE MODIFY INTEGER Option="\x02" Destination="%nDelay%" Value1="%nMinutes%" Value2="60"/>
<DELAY Flags="\x01" Time="%nDelay%"/>
<SOUND FILE File="C:\\Users\\terry\\Sounds\\Sound Effects\\Alarm-Classic.wav" Wait="FALSE" _PROMPT="0x0007"/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs58 %nMinutes% mins\\fs16 \r\n\\par \r\n\\par \\fs58 Finished\\b0\\f1\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

 

  • Like 1
Link to comment
Share on other sites

Yes.  If I Delay for 30 seconds, it eats 25% of the CPU.  If I Delay in two macros running concurrently, it eats 50%.

However, if I use the "Timed Delay" option, I see no increase in CPU usage. 

 

I assume "Timed Delay" sets an operating system interrupt to "Wake me in 30 seconds", where "Delay" probably is a CPU-intensive loop within ME itself.  As advertised, the Delay macro can be cancelled at any time, but Timed Delay can't easily be cancelled until the time expires. 

Link to comment
Share on other sites

Thanks, appreciate your taking the time to check. Was that in MX Pro 6.4.01? I'm surprised I haven't noticed this long ago.

 

I was using Timed Delay until recently, but yesterday I set it for a much longer period (40 mins). Frustrated at being unable to run any other macro, so changed it to Delay. May reverse that now.

 

Link to comment
Share on other sites

14 hours ago, rberq said:

My version of ME is 4.9.  I don't know why you can't run multiple macros simultaneously -- unless you are using the "lock player" command???

 

I've investigated and pleased to find that I was mistaken.

 

An untypical situation. I'd set it to 40 mins instead of the regular 2 or 3. (Failure to collect wife from railway station more serious than over-brewing my teabag.) Decided to use the simple macro hotkey instead of editing one of my more complex alarms - the sort we discussed recently. Its reminder message was still running when I returned to PC hours later. Thought I'd confirm my assumption that it didn't prevent other macros working. So ran a simple shortkey macro in my text editor. That failed to type its string. And again. But my conclusion was too hasty. That (and several of my scores of shortkey macros) have occasionally been unreliable before. That was the cause! 😉

 

Link to comment
Share on other sites

11 hours ago, acantor said:

I also saw high CPU-usage with the delay, and little (or no) effect with the timed delay.

 

Thanks Alan. What version? Any evidence the usage has increased recently? I use a lot of delays (probably more than necessary). Much shorter than that being discussed, of course, but this has me wondering if brief CPU surges could affect other work.

Link to comment
Share on other sites

Hi Terry. I'm using the latest version of Pro, version 6.xx. I haven't checked CPU usage in a long time, so I'm unable report changes.

 

I've used timed delays for eons. I don't remember why or when I stopped using regular delays. My hazy recollection is that they made it harder to abort a running macro, but I can't be sure.

Link to comment
Share on other sites

I tested with my old ME 3 version.  Same high CPU.  Windows Task Manager shows ME running as a App, and again as a Background Process.  The high CPU is reported for the Background process, not for the App.  So that's three versions of ME we have seen with the same high CPU -- ME 3 -- ME Pro 4.9 -- ME Pro 6.   

 

 

Delay_CPU.jpg

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...