Skip to content

Instantly share code, notes, and snippets.

@frockenstein
Created April 3, 2013 12:38
Show Gist options
  • Save frockenstein/5300811 to your computer and use it in GitHub Desktop.
Save frockenstein/5300811 to your computer and use it in GitHub Desktop.
php try catch
<?php
$start = microtime(true);
$loops = 10000000;
$herpes = new stdClass;
for ($i = 0; $i < $loops; $i++) {
try {
$herpes->mouthsores = true;
} catch (Exception $e) { }
}
$end = microtime(true);
$total = round($end - $start, 4);
echo "$total\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment