如何知道特定功能的运行时间?

| 我正在使用PHP和Zend。我的某些代码执行时间过多。知道特定功能/构造函数消耗多少时间的最佳方法是什么。 例如: 我正在调用这样的函数:
$insuranceModel = new Model_Insurance_Object();
$insurances = $insuranceModel->getInsurancesList();
Model_Insurance_Object类中的getInsurancesList函数
public function getInsurancesList() {
  // function body
}
我应该实施什么,应该放在哪里? 谢谢     
已邀请:
XDebug有一个Profiler。看来,这正是您想要的。     
@KingChurch好答案! :D如果您不想走.dll安装路线,也可以写一点2来乘任何代码段的运行时间。
function benchit()
{
    list($msec, $sec) = explode(\' \', microtime());
    return (double)$sec + (double)$msec;
}

$start = benchit();
// ... Some code here
$end = benchit();
    

要回复问题请先登录注册