stress test information :the raw string : '
$str
'"; echo '' , 'function fn_str($str) ' ,''; dump(fn_str($str));echo '' , 'function fn_reg($str) ' ,''; dump(fn_reg($str));}//压力测试function stress_test($str){echo " stress test information :"; $t1 = microtime_float(); fn_reg($str); $t2 = microtime_float(); echo 'begin at time : ' , $t1; echo 'end at time : ' , $t2; echo ' function : fn_reg() cost ' ,$t2 - $t1, ''; $t3 = microtime_float(); fn_str($str); $t4 = microtime_float();echo 'begin at time : ' , $t3; echo 'end at time : ' , $t4; echo ' function : fn_str() costs ' ,$t4 - $t3, '';}//获取时间function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);}//打印变量function dump($var){echo ''; var_dump($var); echo '';}?>
|