PHP time_nanosleep() 函数

PHP 教程 · 2019-01-27 15:11:53

实例

延迟执行当前脚本 3,5 秒:

<?php
if (time_nanosleep(3,500000000) === true)
{
echo "Slept for three and a half a second";
}
?>

定义和用法

time_nanosleep() 函数延迟执行当前脚本若干秒和纳秒。

语法

time_nanosleep(seconds,nanoseconds)

参数 描述
seconds 必需。规定延迟执行脚本的秒数。
nanoseconds 必需。规定延迟执行脚本的纳秒数(必需小于 1,000,000,000)。

技术细节

返回值: 如果成功则返回 0,如果失败则返回 FALSE。

如果调用被信号中断,将返回带有延迟中剩余的秒数和延迟中剩余的纳秒数的关联数组。
PHP 版本: 5+
更新日志: 直到 PHP 5.3.0 版本,该函数才在 Windows 平台下实现。

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

查看所有标签

Modeling the Internet and the Web

Modeling the Internet and the Web

Pierre Baldi、Paolo Frasconi、Padhraic Smyth / Wiley / 2003-7-7 / USD 115.00

Modeling the Internet and the Web covers the most important aspects of modeling the Web using a modern mathematical and probabilistic treatment. It focuses on the information and application layers, a......一起来看看 《Modeling the Internet and the Web》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具