LOADING STUFF...

使用php-timeit估计php函数的执行时间

技术教程2小时前更新 北陌
11 0 0

使用php-timeit估计php函数的执行时间

废话不多说了,直接把我写的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

© 版权声明

相关文章

暂无评论

暂无评论...