I was reading a code of application and something caught my attention. The code was : usleep(6*1000*1000)
. I understand that they use this format for readability issues.
I think that both sleep
and usleep
use the nanosleep
function, so my question is: why not using sleep(6) that does exactly the same thing (ie: sleeps for 6 sec) ? Do we gain in performance when we use usleep
? is usleep
more "generic" ?