2012-05-10 3 views
2

가능한 중복 :
Why is this microtime showing up weird in PHPPHP는 perfomance의 microtime 진정한 가치

내가 스크립트의 성능을 확인하기 위해이 코드를 사용합니다.

$start_time = microtime(1); 
// execution some code 
$cpu_time = microtime(1) - $start_time; 

에코 $의 cpu_time의 출력은 3.0994415283203E-6 같은 방법 화면에 0.000000003099처럼 실제 값으로 표시하는 것입니다? 0 초이고 매우 빠른 실행입니까? :)

답변

3

오른쪽 : 로 number_format() 함수를 사용해보십시오 :

echo number_format($cpu_time, 12); 
1

사용 bcsub

echo bcsub (microtime (1), $start_time, 16);