且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

启动和停止计时器 PHP

更新时间:2023-12-04 08:50:16

你可以使用microtime 计算差异:

You can use microtime and calculate the difference:

$time_pre = microtime(true);
exec(...);
$time_post = microtime(true);
$exec_time = $time_post - $time_pre;

以下是 microtime 的 PHP 文档:http://php.net/manual/en/function.microtime.php

Here's the PHP docs for microtime: http://php.net/manual/en/function.microtime.php