How to pause a script just for a fraction of a second in PHP using the SLEEP() function?
问题 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 or 0.01 or .01 ? Q2. What are alternatives? wait(); or snap(); ?? how do they differ (more/less precise)? 回答1: Q1. How to make this 1/100 of a second? which of these work: 0,01 or 0.01 or .01 ? None of the above! usleep is what you want for fractions of a second. usleep(100000) will sleep for one tenth of one second. Your other options are time_nanosleep