Created
December 5, 2013 01:31
-
-
Save miio/7798738 to your computer and use it in GitHub Desktop.
benchmark test
This file contains 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 | |
class A { | |
public function getA() { | |
return "A"; | |
} | |
} | |
function getA() { | |
return "A"; | |
} | |
$start_m = microtime(); | |
$start = time(); | |
$a = new A(); | |
var_dump($a->getA()); | |
$end_m = microtime(); | |
$end = time(); | |
$bench = ($end - $start) + ($end_m - $start_m); | |
var_dump($bench); |
This file contains 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
$ cat func.php | |
<?php | |
function getA() { | |
return "A"; | |
} | |
$start_m = microtime(); | |
$start = time(); | |
var_dump(getA()); | |
$end_m = microtime(); | |
$end = time(); | |
$bench = ($end - $start) + ($end_m - $start_m); | |
var_dump($bench); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment