Home > Backend Development > PHP Tutorial > Introduction to the usage of usleep() function in php

Introduction to the usage of usleep() function in php

WBOY
Release: 2016-07-25 08:58:27
Original
1812 people have browsed it
This article introduces the usage of usleep() function in PHP. Friends who need it can refer to it.

Definition and usage usleep() function delays code execution for a number of microseconds.

Grammar usleep(microseconds)

Parameter Description microseconds required. Pause time in microseconds.

Return value No return value.

Tips and Notes Note: Before PHP 5, this function did not work on Windows systems. Note: One microsecond is equal to one millionth of a second.

For example:

<?php
echo date('h:i:s') . "<br />";

//延迟 10 描述
usleep(10000000);

//再次开始
echo date('h:i:s');
?>
Copy after login

Output: 09:23:14 09:23:24



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template