donnyh13 Posted November 20, 2023 Share Posted November 20, 2023 I am wondering when is a sleep needed in a non-infinite loop. Such as searching/filling an Array, etc. If the array is larger than x amount of elements? Or just good practice to have a sleep in a loop no matter what? LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." Link to comment Share on other sites More sharing options...
Solution Andreik Posted November 20, 2023 Solution Share Posted November 20, 2023 Nah, if you need to process an array or something there is no reason to sleep IMO. You want to process as fast as possible. CPU usage might be higher for a period of time but what good to have low CPU usage and slow running code? donnyh13 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
donnyh13 Posted November 20, 2023 Author Share Posted November 20, 2023 Ya, good point, thanks @Andreik. LibreOffice UDF ; Scite4AutoIt Spell-Checker Using LibreOffice Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions." 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