Jump to content

When to Sleep in a loop


Go to solution Solved by Andreik,

Recommended Posts

Posted

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

  Reveal hidden contents

 

  • Solution
Posted

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?

Posted

Ya, good point, thanks @Andreik.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...