Last active
November 22, 2019 09:40
-
-
Save HaiBV/bce9461fc946d632784abbf3e9bf1113 to your computer and use it in GitHub Desktop.
Benchmarking PHP code block
This file contains 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
$n = 1000000; | |
$time1 = microtime(true); | |
$mem1 = memory_get_usage(true); | |
for ($i = 0; $i < $n; $i++) | |
{ | |
} | |
$time2 = microtime(true); | |
$mem2 = memory_get_usage(true); | |
echo "Test 1: time " . $time2 - $time1 . " - mem " . $mem2 - $mem1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment