多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
HRTime扩展实现了高分辨率的StopWatch类。它在不同平台上使用了最好的API,从而使解析度达到了纳秒级。它还可以使用底层API传递的低级滴答来实现自定义秒表。 从PHP 7.3.0开始,相关函数[hrtime()](https://www.php.net/manual/en/function.hrtime.php)是核心部分。 [https://pecl.php.net/package/hrtime](https://pecl.php.net/package/hrtime) * [范例](https://www.php.net/manual/zh/hrtime.examples.php) * [Basic usage](https://www.php.net/manual/zh/hrtime.example.basic.php) * [HRTime\\PerformanceCounter](https://www.php.net/manual/zh/class.hrtime-performancecounter.php)— The HRTime\\PerformanceCounter 类 * [HRTime\\PerformanceCounter::getFrequency](https://www.php.net/manual/zh/hrtime-performancecounter.getfrequency.php)— 计时器频率(以秒为单位) * [HRTime\\PerformanceCounter::getTicks](https://www.php.net/manual/zh/hrtime-performancecounter.getticks.php)— 当前从系统滴答 * [HRTime\\PerformanceCounter::getTicksSince](https://www.php.net/manual/zh/hrtime-performancecounter.gettickssince.php)— 从给定值开始计时 ***** * [HRTime\\StopWatch](https://www.php.net/manual/zh/class.hrtime-stopwatch.php)— The HRTime\\StopWatch 类 * [HRTime\\StopWatch::getElapsedTicks](https://www.php.net/manual/zh/hrtime-stopwatch.getelapsedticks.php)—获取所有间隔的运行时间 * [HRTime\\StopWatch::getElapsedTime](https://www.php.net/manual/zh/hrtime-stopwatch.getelapsedtime.php)—取所有间隔的运行时间 * [HRTime\\StopWatch::getLastElapsedTicks](https://www.php.net/manual/zh/hrtime-stopwatch.getlastelapsedticks.php)— 获取最后一个间隔的运行时间 * [HRTime\\StopWatch::getLastElapsedTime](https://www.php.net/manual/zh/hrtime-stopwatch.getlastelapsedtime.php)— 获取最后一个间隔的运行时间 * [HRTime\\StopWatch::isRunning](https://www.php.net/manual/zh/hrtime-stopwatch.isrunning.php)— 测量是否正在运行 * [HRTime\\StopWatch::start](https://www.php.net/manual/zh/hrtime--开始时间测量 * [HRTime\\StopWatch::stop](https://www.php.net/manual/zh/hrtime-停止时间测量 ***** * [HRTime\\Unit](https://www.php.net/manual/zh/class.hrtime-unit.php)— The HRTime\Unit 类