Created
March 2, 2016 15:27
-
-
Save postpostscript/cfa03eed8db62d0b03bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$profiles = array(); | |
function profile_start($key) { | |
global $profiles; | |
$profiles[$key] = array(); | |
$profiles[$key]["start"] = microtime(true); | |
} | |
function profile_end($key) { | |
global $profiles; | |
$profiles[$key]["end"] = microtime(true); | |
$profiles[$key]["value"] = $profiles[$key]["end"] - $profiles[$key]["start"]; | |
} | |
function profile_val($key) { | |
global $profiles; | |
return $profiles[$key]["value"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment