Created
September 18, 2018 00:33
-
-
Save ufhy/f12cfcf34d05cb6894a0f017d502d7db to your computer and use it in GitHub Desktop.
Snippet Code To Benchmark Your PHP Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = microtime(true); | |
// Script you want to test here | |
usleep(200000); // sleep 2 seconds | |
$end = microtime(true); | |
$r = round($end - $start,4); | |
echo '<strong>Execution Time</strong>: '.$r.' seconds<br />'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment