Skip to content

Instantly share code, notes, and snippets.

@habibun
Created December 15, 2015 14:30
Show Gist options
  • Save habibun/ef0a17d7b8fd53f4c648 to your computer and use it in GitHub Desktop.
Save habibun/ef0a17d7b8fd53f4c648 to your computer and use it in GitHub Desktop.
check script execution time
<?php
// Start timing
$startTime = microtime( true );
// Perform the operation
for ( $i=0; $i<10; $i++ ) {
echo "<p>Hello, world!</p>";
}
// Stop timing
$endTime = microtime( true );
$elapsedTime = $endTime - $startTime;
printf( "<p>The operation took %0.6f seconds to execute.</p>", $elapsedTime );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment