How to pause a script just for a fraction of a second in PHP using the SLEEP() function?

前端 未结 4 1099
渐次进展
渐次进展 2020-12-11 16:43
sleep(1);   #waits/sleeps for one second then continue running the script

Q1. How to make this 1/100 of a second? which of these work: 0,01

4条回答
  •  情歌与酒
    2020-12-11 17:20

    What you are looking for is usleep() or time_nanosleep().

    As for your second question, all these methods come with a high level of precision however I would advise you to test on your specific system if it's critical.

提交回复
热议问题