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://codercto.com/courses/l/5.html
About Face 3
Alan Cooper、Robert Reimann、David Cronin / John Wiley & Sons / 2007-5-15 / GBP 28.99
* The return of the authoritative bestseller includes all new content relevant to the popularization of how About Face maintains its relevance to new Web technologies such as AJAX and mobile platforms......一起来看看 《About Face 3》 这本书的介绍吧!