0
我使用php命令microTime(true)从服务器检索时间。PHP - 以微秒为单位计算时间,在整秒内作出反应
我想在每次达到完整的秒数时触发一个事件,我需要用微秒的精度来确定何时达到完整的秒数。
这是我的代码至今:
$time_start = microtime(true);
while($someValue){
if(microtime(true)==time()){
echo "<p>".microtime(true)."</p>";
echo "<p>".time()."</p>";
}
//sleep for one microsecond
usleep(1);
}
有人能帮助或向我解释如何得到这个权利?