Created
January 15, 2018 03:06
-
-
Save laruence/fd0d443d2c5bacca9d8ab99250499956 to your computer and use it in GitHub Desktop.
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
<?php | |
$retry = 10; | |
$start = microtime(true); | |
while (--$retry) { | |
$length = (int)(300/$retry); | |
$str = file_get_contents("/dev/urandom", false, NULL, 0, $length); | |
//echo "String lenght: ", $length, "\n"; | |
$time = microtime(true); | |
for ($i = 0; $i < 1000000; $i++) { | |
addslashes($str); | |
} | |
$time = microtime(true) - $time; | |
//echo "Used time: ", $time , "s", "\n"; | |
} | |
echo "Total used time: ", microtime(true) - $start, "s\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment