PHP usleep() 函数
PHP 教程
· 2019-01-27 16:11:59
实例
延迟执行当前脚本 5 秒(5000000 纳秒):
<?php
echo date('h:i:s') . "<br>";
//sleep for 5 seconds
usleep(5000000);
//start again
echo date('h:i:s');
?>
echo date('h:i:s') . "<br>";
//sleep for 5 seconds
usleep(5000000);
//start again
echo date('h:i:s');
?>
定义和用法
usleep() 函数延迟执行当前脚本若干微秒(一微秒等于一百万分之一秒)。
注释:如果指定秒数是负数,该函数将抛出一个错误。
语法
usleep(microseconds)
| 参数 | 描述 |
|---|---|
| microseconds | 必需。规定延迟执行脚本的微秒数。 |
技术细节
| 返回值: | 没有返回值。 |
|---|---|
| PHP 版本: | 4+ |
| 更新日志: | 直到 PHP 5 版本,该函数才在 Windows 平台下实现。 |
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Design and Analysis of Distributed Algorithms (Wiley Series on P
Nicola Santoro / Wiley-Interscience / 2006-10-27 / USD 140.95
This text is based on a simple and fully reactive computational model that allows for intuitive comprehension and logical designs. The principles and techniques presented can be applied to any distrib......一起来看看 《Design and Analysis of Distributed Algorithms (Wiley Series on P》 这本书的介绍吧!