Created
January 21, 2014 10:20
-
-
Save Thinkscape/8537581 to your computer and use it in GitHub Desktop.
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 | |
namespace Foo { | |
class Bar { | |
public function baz() { | |
return strlen('Regarding the overhead: Just keep in mind, that a typical application calls built-in functions many thousand times. Even if the difference is small: It exists.'); | |
} | |
} | |
$start = microtime(true); | |
$foo = new Bar; | |
for($x = 0; $x < 1000000; $x++) { | |
$foo->baz(); | |
} | |
echo "Time: " . number_format((microtime(true) - $start), 5, "."," ") . " s\n"; | |
} |
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 | |
namespace Foo { | |
class Bar { | |
public function baz() { | |
return \strlen('Regarding the overhead: Just keep in mind, that a typical application calls built-in functions many thousand times. Even if the difference is small: It exists.'); | |
} | |
} | |
$start = microtime(true); | |
$foo = new Bar; | |
for($x = 0; $x < 1000000; $x++) { | |
$foo->baz(); | |
} | |
echo "Time: " . number_format((microtime(true) - $start), 5, "."," ") . " s\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And here come inconclusive bogus that vary only because my cpu usage changes from 3% to 4% occasionally as I move my cursor, or some browser tab refreshes itself in the background. Bottomline, no difference there.