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');
?>

定义和用法

usleep() 函数延迟执行当前脚本若干微秒(一微秒等于一百万分之一秒)。

注释:如果指定秒数是负数,该函数将抛出一个错误。

语法

usleep(microseconds)

参数 描述
microseconds 必需。规定延迟执行脚本的微秒数。

技术细节

返回值: 没有返回值。
PHP 版本: 4+
更新日志: 直到 PHP 5 版本,该函数才在 Windows 平台下实现。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Structure and Interpretation of Computer Programs - 2nd Edition

Structure and Interpretation of Computer Programs - 2nd Edition

Harold Abelson、Gerald Jay Sussman / The MIT Press / 1996-7-25 / USD 145.56

Structure and Interpretation of Computer Programs has had a dramatic impact on computer science curricula over the past decade. This long-awaited revision contains changes throughout the text. Ther......一起来看看 《Structure and Interpretation of Computer Programs - 2nd Edition 》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具