Measure the time spend on executing the script is important. You can add a X-runtime header to the HTTP headers with the information of executing time. This is how I do in Drupal 6/7:

function YourModule_init() {
  timer_start('x-runtime');
}
function YourModule_exit() {
  $x_runtime = timer_stop('x-runtime');
  $x_runtime = $x_runtime['time'];
  //drupal_set_header("X-runtime: $x_runtime ms"); //D6
  drupal_add_http_header('X-Runtime', "$x_runtime ms", TRUE); //D7
}

推荐这些相关文章

订阅这个博客:

关注我的微博:

关注我的推特: