Skip to content

Instantly share code, notes, and snippets.

@andrewle
Created June 2, 2010 21:18
Show Gist options
  • Save andrewle/423009 to your computer and use it in GitHub Desktop.
Save andrewle/423009 to your computer and use it in GitHub Desktop.
define('START_TIME', microtime(true));
function benchmark($class, $function, $line)
{
error_log("dt => {$class}->{$function}:{$line} at: " . (microtime(true) - START_TIME) . " seconds.");
}
//Call by doing:
benchmark(__CLASS__, __FUNCTION__, __LINE__);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment