Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active February 4, 2016 06:22
Show Gist options
  • Save kurozumi/92e91c06fe8ad82088ba to your computer and use it in GitHub Desktop.
Save kurozumi/92e91c06fe8ad82088ba to your computer and use it in GitHub Desktop.
【PHP】シンプルなベンチマーククラスの使い方
<?php
$benchmark = new Benchmark();
$benchmark->mark("start");
sleep(5);
$benchmark->mark("stop");
sleep(5);
$benchmark->mark("end");
try {
echo $benchmark->getTime("start", "stop") . PHP_EOL;
echo $benchmark->getTime("start", "end") . PHP_EOL;
} catch (Exception $ex) {
echo $ex->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment