eitan Posted December 29, 2005 Posted December 29, 2005 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
BigDod Posted December 29, 2005 Posted December 29, 2005 hi alli am building a project that monitors a web page.the program sits idle until a set time and then updates the pagewhich it does a few times a day.i put the time polling routine inside the While 1 $msg = GUIGetMsg() ... ... WEndloop 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?thanksIf you place a Sleep(100) after While 1 that will ease the stress on the CPU. 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
eitan Posted December 29, 2005 Author Posted December 29, 2005 thanks a lot cpu usage went down from 60 to 23 !!!
seandisanti Posted December 29, 2005 Posted December 29, 2005 thanks a lotcpu 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...
eitan Posted December 31, 2005 Author Posted December 31, 2005 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
MHz Posted December 31, 2005 Posted December 31, 2005 (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. Edit: more definition Edited December 31, 2005 by MHz
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now