How to sleep using processor resources?
Does it use 100% or 0% of the processor when you sleep the script. Can you explain?
As far as I know, it increases the average load, but how does it use the CPU?
The way sleep works depends on the OS, because the PHP sleep function calls the corresponding runtime function to actually do what it says to tin.
sleep
For Windows, this feature is SleepEx . For other operating systems, this is the POSIX sleep function. In both cases, the documentation for these functions clearly states that the sleeping thread is not suitable for work during the waiting period and therefore cannot consume CPU resources, even if it wants to.
SleepEx
Source: https://habr.com/ru/post/944214/More articles:Implementing a simple HTTPS proxy application with Java? - javaHow to get column names from a database in memory? - javaSSIS API: how do I know which interface to use to create __COMObject? - sql-server-2008D3 Power Link Graph - self-connectivity node - d3.jsInsert date and time in MySql db - pythonSpecial photoswipe toolbar with jQuery mobile - javascriptHow to add multithreading? - powershellJavaFX table - how to add components? - javafxWhat is the purpose of "Macros for whole constants of minimum width" - cSQL VIEW Unsupported data type - sql-serverAll Articles