Skip to content

Instantly share code, notes, and snippets.

@fgilio
Created February 7, 2016 20:22
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 fgilio/73f4babf2957ad33f3b2 to your computer and use it in GitHub Desktop.
Save fgilio/73f4babf2957ad33f3b2 to your computer and use it in GitHub Desktop.
PHP - Use microtime to benchmark scripts
<?php
$time_start = microtime(true);
// Run code here
$time_end = microtime(true);
$time = $time_end - $time_start;
echo '<br> <h1> Time = '.$time.' seconds. </h1> <br>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment