TheGenius22
MIS
Hello,
I have a simple question really. In one of my programs, I have a while loop. A fellow programmer recommended to sleep for 1 ms at the end of the loop to be cpu friendly. (it was at 100% before implementing it and reduced cpu usage to 0% on idle). My question : is there a way to sleep for less then 1 ms ? maybe a nano sec or something. No matter how complicated, I would like to know the answer.
Thank you
I have a simple question really. In one of my programs, I have a while loop. A fellow programmer recommended to sleep for 1 ms at the end of the loop to be cpu friendly. (it was at 100% before implementing it and reduced cpu usage to 0% on idle). My question : is there a way to sleep for less then 1 ms ? maybe a nano sec or something. No matter how complicated, I would like to know the answer.
Thank you