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://codercto.com/courses/l/5.html

查看所有标签

The Little MLer

The Little MLer

Matthias Felleisen、Daniel P. Friedman、Duane Bibby、Robin Milner / The MIT Press / 1998-2-19 / USD 34.00

The book, written in the style of The Little Schemer, introduces instructors, students, and practicioners to type-directed functional programming. It covers basic types, quickly moves into datatypes, ......一起来看看 《The Little MLer》 这本书的介绍吧!

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

各进制数互转换器

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

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

HSV CMYK互换工具