让Apache记录每个访问的运行时间

{{ time }}

在httpd.conf的<Virtual Host>节点里, 加入如下语句

CustomLog "c:/apache_log.log" "[%a]%{%F %T}t id=%{APIIndex}i time=%D(us) 

url=%U%q"

然后c:/apache_log.log就是你的日志文件, 里面的内容像下面

[124.64.19.29]2020-11-30 16:37:20 id=- time=19532(us) url=/index.php?m=poster&c=index&a=show_poster&id=1

时间单位应该是微妙

这也适用于Linux