Explorar o código

记录php执行时间

visuddhinanda %!s(int64=4) %!d(string=hai) anos
pai
achega
246d5e56c5
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      app/log/pref_log.php

+ 14 - 0
app/log/pref_log.php

@@ -0,0 +1,14 @@
+<?php
+require_once("../path.php");
+$logstart = microtime(true)*1000;
+$strstart = date("h:i:sa");
+function PrefLog(){
+	$file = fopen(_DIR_LOG_."/pref_".date("Y-m-d").".log","a");
+	if($file){
+		fputcsv($file,[$_SERVER['PHP_SELF'],$GLOBALS['strstart'],sprintf("%d",microtime(true)*1000-$GLOBALS['logstart']),$_SERVER['REMOTE_ADDR']]);
+		fclose($file);
+	}
+}
+
+
+?>