Created
July 29, 2015 10:18
-
-
Save jeremyquinton/5e231c0081b088a9abee 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 | |
function microtime_float() | |
{ | |
list($usec, $sec) = explode(" ", microtime()); | |
return ((float)$usec + (float)$sec); | |
} | |
$time_start = microtime_float(); | |
$string = "testing string 123"; | |
$number = 2000; | |
$text = "fdddddd dewwwwww"; | |
for($i = 0; $i <= 100000; $i++) { | |
$string .= " adding some text " . $number . $text; | |
} | |
$time_end = microtime_float(); | |
$time = $time_end - $time_start; | |
echo "echo double quotes took $time\n"; | |
$time_start = microtime_float(); | |
$string = "testing string 123"; | |
$number = 2000; | |
$text = 'fdddddd dewwwwww'; | |
for($i = 0; $i <= 100000; $i++) { | |
$string .= ' adding some text ' . $number . $text; | |
} | |
$time_end = microtime_float(); | |
$time = $time_end - $time_start; | |
echo "echo single quotes took $time\n"; | |
Author
jeremyquinton
commented
Jul 29, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment