📜  如何在 laravel 中检查查询执行时间 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:40.180000             🧑  作者: Mango

代码示例1
//place this before any script you want to calculate time
$time_start = microtime(true); 

//sample script
for($i=0; $i<1000; $i++){
 //do anything
}

$time_end = microtime(true);
$execution_time = ($time_end - $time_start);
echo 'Total Execution Time: '.($execution_time*1000).'Milliseconds';