Jump to content
Sign in to follow this  
eitan

program structre question

Recommended Posts

eitan

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
BigDod

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
eitan

thanks a lot

cpu usage went down from 60 to 23 !!!

Share this post


Link to post
Share on other sites
seandisanti

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

Share this post


Link to post
Share on other sites
eitan

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
MHz

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  

×