最近在做项目分别使用了TP5.0,TP5.1查看日志文件的时间发现一个有趣的问题,
以我做过的测试代码为例
for ($i = 0; $i < 700; $i++) {
$tmp[‘name‘] = ‘f_‘.$i;
$tmp[‘times‘] = date(‘Y-m-d H:i:s‘);
db(‘task‘)->insert($tmp);
}
很简单的代码,就是在task这个表中连续插入700条数据。
在使用TP5.1的时候,查看日志文件发现
[ sql ] [ DB ] CONNECT:[ UseTime:0.000533s ] mysql:host=127.0.0.1;dbname=xun_php_cn;charset=utf8
[ sql ] [ SQL ] INSERT INTO `op_task` (`name` , `times`) VALUES (‘f_7‘ , ‘2019-11-20 16:19:52‘) [ RunTime:0.001197s ]
[ sql ] [ DB ] CONNECT:[ UseTime:0.000514s ] mysql:host=127.0.0.1;dbname=xun_php_cn;charset=utf8
[ sql ] [ SQL ] INSERT INTO `op_task` (`name` , `times`) VALUES (‘f_8‘ , ‘2019-11-20 16:19:52‘) [ RunTime:0.001186s ]
[ sql ] [ DB ] CONNECT:[ UseTime:0.000546s ] mysql:host=