Skip to content

Instantly share code, notes, and snippets.

@yidas
Last active December 26, 2017 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yidas/5da6a024447750f07a81298be6ef630c to your computer and use it in GitHub Desktop.
Save yidas/5da6a024447750f07a81298be6ef630c to your computer and use it in GitHub Desktop.
<?php
$startTime = time();
$runSeconds = 5;
$rounds = 5;
$count = 0;
for ($i=0; $i<$rounds; $i++) {
while ((time()-$startTime) <= $runSeconds) {
serialize(['bar'=>'foo']);
$count ++;
}
$round = $i+1;
$startTime += $runSeconds;
$count = number_format($count);
echo "Round {$round}: {$count} /per {$runSeconds} second\n";
$count = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment