1. 首页
  2. 数据库
  3. 其它
  4. PHP获取MySQL执行sql语句的查询时间方法

PHP获取MySQL执行sql语句的查询时间方法

上传者: 2020-12-23 05:36:55上传 PDF文件 60.91KB 热度 25次
如下所示: //计时开始 runtime(); //执行查询 mysql_query($sql); //计时结束. echo runtime(1); //计时函数 function runtime($mode=0) { static $t; if(!$mode) { $t = microtime(); return; } $t1 = microtime(); list($m0,$s0) = explode(" ",$t); list($m1,$s1) = explode(" ",$t1); return sprintf("%.3f ms",($s1+$m1-$s0-$m
下载地址
用户评论