Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created August 11, 2013 23:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msonnabaum/6207289 to your computer and use it in GitHub Desktop.
Save msonnabaum/6207289 to your computer and use it in GitHub Desktop.
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
register_shutdown_function(function () {
$namespace = 'sitename';
$filename = '/tmp/' . uniqid() . '.' . $namespace . '.xhprof';
file_put_contents($filename, serialize(xhprof_disable()));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment