argumentum Posted May 31, 2015 Share Posted May 31, 2015 (edited) At times I see in posts advise to use a way or another for a loop, in this case I'd like to know if:While 1 Switch GUIGetMsg() ... ... EndSwitch If $HOUR = @HOUR Then ContinueLoop $HOUR = @HOUR someFunc() Wendis easier on the CPU than AdlibRegister() would be.Also, how can I determine whats better, how do you test this.ThanksEDIT: found my answer ( https://www.autoitscript.com/forum/topic/172958-what-is-easier-on-a-cpu/?do=findComment&comment=1251164 ) Edited June 1, 2015 by argumentum found my answer Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
kaisies Posted June 1, 2015 Share Posted June 1, 2015 (edited) I don't think your thinking of that correctly, it looks like your while loop is to hold the gui open, and using functions after your guimsg switch vs using adlib isn't going to be easier one way or the other on the cpu. You just need to take care with your other functions that they don't eat cpu cycles so much. If they do then you could miss gui actions. My decent understanding,could be wrong,or I'm not understanding the question. Edited June 1, 2015 by kaisies Link to comment Share on other sites More sharing options...
argumentum Posted June 1, 2015 Author Share Posted June 1, 2015 @kaisies, one would compare IF THEN 100 times a second ( give or take ). Maybe an ADLIB would take less flip-flops. Maybe the IF THEN is queued. No clue. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 1, 2015 Moderators Share Posted June 1, 2015 Maybe an ADLIB would take less flip-flops. Maybe the IF THEN is queued. No clue.Have you tried it yourself? What did you experience? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
argumentum Posted June 1, 2015 Author Share Posted June 1, 2015 nope @JLogan3o13, I have not tried anything. I find the "IF $MIN = @MIN THEN" or something like that to be very simple and the impact to today's PCs goes unnoticed. But I got curious on what is less CPU demanding and how can be tested. Even tho I write, I'm not a programmer, know no assembly or anything that would give me the authority to determine how to go about it. But I have seen posts where the better, more efficient mode of writing is presented. So I opened this topic in the hopes that the well versed in the topic share their experience and present a reasonable procedure for testing the possible inefficiencies in the code for ourselves. Maybe there is software written for that purpose. No clue other than what in one's experience, is common sense. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
kaisies Posted June 1, 2015 Share Posted June 1, 2015 Testing "CPU demanding" isn't hard, you do something 100,000 times one way, and 100,000 times the other way, and see what takes longer. It doesn't take "assembly", just 5 minutes of programming. Link to comment Share on other sites More sharing options...
argumentum Posted June 1, 2015 Author Share Posted June 1, 2015 If that is the only methodology @kaisies, then that's that, but there has to be better tooling than just that or tooling to aid that. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted June 1, 2015 Author Share Posted June 1, 2015 ok, Adlib is better. Tested with https://www.autoitscript.com/forum/topic/84441-how-do-i-get-the-cpu-useage-of-a-program/?do=findComment&comment=605045 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
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