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

查看所有标签

Squid: The Definitive Guide

Squid: The Definitive Guide

Duane Wessels / O'Reilly Media / 2004 / $44.95 US, $65.95 CA, £31.95 UK

Squid is the most popular Web caching software in use today, and it works on a variety of platforms including Linux, FreeBSD, and Windows. Squid improves network performance by reducing the amount of......一起来看看 《Squid: The Definitive Guide》 这本书的介绍吧!

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

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码