Skip to content

Instantly share code, notes, and snippets.

@Anye
Created August 6, 2014 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anye/2e93503967e361fa114d to your computer and use it in GitHub Desktop.
Save Anye/2e93503967e361fa114d to your computer and use it in GitHub Desktop.
使用 xhprof
<?php
xhprof_enable(XHPROF_FLAGS_CPU+XHPROF_FLAGS_MEMORY);
register_shutdown_function(function() {
$xhprof_data = xhprof_disable();
include_once __DIR__ . '/xhprof/xhprof_lib/utils/xhprof_lib.php';
include_once __DIR__ . '/xhprof/xhprof_lib/utils/xhprof_runs.php';
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, "ce");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment