Last active
May 24, 2018 17:48
-
-
Save bantya/483407c271d667ffa24431f88c4234e0 to your computer and use it in GitHub Desktop.
PHP: Speed test placeholder
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 | |
| // Adapted from: https://r.je/sprintf.html | |
| $iterations = 500000; | |
| $t1 = microtime(true); | |
| for ($i = 0; $i < $iterations; $i++) { | |
| // Test operation 1 here | |
| } | |
| $t2 = microtime(true); | |
| echo 'strongTest1: ' . ($t2-$t1); | |
| echo '<br />'; | |
| $t1 = microtime(true); | |
| for ($i = 0; $i < $iterations; $i++) { | |
| // Test operation 2 here | |
| } | |
| $t2 = microtime(true); | |
| echo 'Test2: ' . ($t2-$t1); | |
| echo '<br />'; | |
| die; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment