$t1 = microtime(true); //代碼 $t2 = microtime(true); echo '耗時'.round($t2-$t1,3).'秒<br>'; echo 'Now memory_get_usage: ' . memory_get_usage() . '<br />'; exit(); $__start__ = microtime( true ); /*** original benchmark script code here ***/ fprintf( STDERR, microtime( true ) - $__start__);
來源:php