Skip to content

Instantly share code, notes, and snippets.

@miukoba
Created December 12, 2013 02:35
Show Gist options
  • Save miukoba/7922376 to your computer and use it in GitHub Desktop.
Save miukoba/7922376 to your computer and use it in GitHub Desktop.
PHPのパフォーマンス簡易測定
<?php
$startTime = microtime(true);
// 処理
//for ($i = 0; $i < 10000; ++$i)
//{
//}
echo PHP_EOL . PHP_EOL;
echo '>>> result >>>>>>>>>>>>>>>>>>>>>>>>>>>' . PHP_EOL;
echo "process time: " . (microtime(true) - $startTime) . ' ms' . PHP_EOL;
echo "memory_get_peak_usage: " . (memory_get_peak_usage(true) / 1048576) . 'MB' . PHP_EOL;
echo '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<' . PHP_EOL;
echo PHP_EOL . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment