Created
May 28, 2014 12:55
-
-
Save tassoevan/1730c5890941a339c38d 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 galvao(array $a) { | |
$b = array('e', array_pop($a)); | |
echo implode(', ', $a) . ' ' . implode(' ', $b); | |
} | |
function tassoevan(array $times) { | |
echo implode(', ', array_slice($times, 0, -1)), ' e ', end($times); | |
} | |
$times = array('Chelsea', 'Liverpool', 'Manchester United', 'Manchester City'); | |
for ( ; ; ) { | |
$start = microtime(true); | |
galvao($times); | |
echo "\ngalvao: ", microtime(true) - $start, "\n\n"; | |
$start = microtime(true); | |
tassoevan($times); | |
echo "\ntassoevan: ", microtime(true) - $start, "\n\n"; | |
sleep(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment