PIXNET
- Jul 14 Tue 2015 18:10
0714test
- May 23 Sat 2015 15:56
測試
測試
- Apr 24 Fri 2015 10:24
test POST new article
new article
- Dec 01 Sun 2013 02:07
PHP 執行時間計算 (PHP 5.4)
PHP 5.4 起,新增了一個環境變數 $_SERVER['REQUEST_TIME_FLOAT'],記錄了程式開始執行時的時間戳記
量測程式的執行時間變得簡單不少,只需使用 microtime(true) 做相減即可
範例程式:
<?php
echo 'start' . PHP_EOL;
sleep(3);
$exec_time = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
echo 'execution time = ' . $exec_time . PHP_EOL;
- May 29 Wed 2013 11:01
app test 0529 (2013)