
废话不多说了,直接把我写的timeit函数分享给大家,具体内容如下:
/**
* Compute the delay to execute a function a number of time
* @param $count Number of time that the tests will execute the given function
* @param $function the function to test. Can be a string with parameters (ex: myfunc(123, 0, 342)) or a callback
* @return float Duration in seconds (as a float)
*/
function timeit($count, $function) {
if ($count
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...