php 判断sql执行时间

<?php
function getmicrotime()
{
    list($usec$sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
}
  
// 记录开始时间
$time_start = getmicrotime();
     
// 这里放要执行的PHP代码,如:
// echo create_password(6);
  
// 记录结束时间
$time_end = getmicrotime();
$time $time_end $time_start;
 
 // 输出运行总时间 
echo "执行时间 $time seconds";
原文地址:https://www.cnblogs.com/zlking/p/9003241.html