Sign in to follow this  
Followers 0
eitan

program structre question

6 posts in this topic

hi all

i am building a project that monitors a web page.

the program sits idle until a set time and then updates the page

which it does a few times a day.

i put the time polling routine inside the

While 1

$msg = GUIGetMsg()

...

...

WEnd

loop to insure that it will be checked but this stresses the cpu.

where do you suggest i place these routines?

if i place them outside the loop will the program continue to monitor the time event?

thanks

Share this post


Link to post
Share on other sites



hi all

i am building a project that monitors a web page.

the program sits idle until a set time and then updates the page

which it does a few times a day.

i put the time polling routine inside the

While 1

$msg = GUIGetMsg()

...

...

WEnd

loop to insure that it will be checked but this stresses the cpu.

where do you suggest i place these routines?

if i place them outside the loop will the program continue to monitor the time event?

thanks

If you place a Sleep(100) after While 1 that will ease the stress on the CPU.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

thanks a lot

cpu usage went down from 60 to 23 !!!

Share this post


Link to post
Share on other sites

thanks a lot

cpu usage went down from 60 to 23 !!!

you could probably use a larger sleep even, unless you need to know instantly when the page updates...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

you cant use a larger sleep because otherwise actions will be perforemed

continuesly (or you need to program checks for one time actions)

if the actions are time based and you want them perfomed once, you need the down to the exact

second, and add a sleep for a second

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

GUIGetMsg() is supposed to idle the cpu. Using Sleep() is not recommended in a loop using GuiGetMsg(). I cannot advise a solution as the relevent code structure that is possibly stressing the cpu is not supplied. Supply the code where those ... are and a better chance of help can be offered. :P

Edit: more definition

Edited by MHz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0