2010-07-27 31 views
0

PHP mico時間,我想使用microtime來處理我的應用程序microtime如何在php

+1

你是什麼意思*處理我的申請*? – JoseK 2010-07-27 12:16:32

+1

+0模糊。 – 2010-07-27 12:18:46

+0

我想,psr123正在討論應用程序分析。 XDebug將幫助您調試和分析您的應用程序。 – Kirzilla 2010-07-27 12:37:27

回答

3

我認爲PHP5的PHP.net腳本示例非常簡單。

<?php 
// Put this at the start of your script 
$time_start = microtime(true); 

// This is where your script should be executing, 
// but instead, we sleep for a while 
usleep(100); 

// Calculation at the end of the script 
$time_end = microtime(true); 
$time = $time_end - $time_start; 

// Do something with the results 
echo "Did nothing in $time seconds\n"; 
?>