Difference among sleep() and usleep() in PHP

前端 未结 5 1493
执笔经年
执笔经年 2021-01-07 17:35

Can any body explain me what is the difference among sleep() and usleep() in PHP.

I have directed to use following scripts to do chat appli

5条回答
  •  [愿得一人]
    2021-01-07 18:09

    The argument to sleep is seconds, the argument to usleep is microseconds. Other than that, I think they're identical.

    sleep($n) == usleep($n * 1000000)
    

    usleep(25000) only sleeps for 0.025 seconds.

提交回复
热议问题