Skip to content

Instantly share code, notes, and snippets.

@flesch
Created February 25, 2010 20:16
Show Gist options
  • Save flesch/314984 to your computer and use it in GitHub Desktop.
Save flesch/314984 to your computer and use it in GitHub Desktop.
PHP Benchmarking
<?php
function utime() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
// Start benchmarking.
$start = utime();
// At end of file.
echo sprintf('Rendered in %s seconds.', number_format(utime() - $start, 3));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment