Created
September 8, 2013 20:18
-
-
Save samdark/6488056 to your computer and use it in GitHub Desktop.
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); | |
function get_cache_value() { | |
return rand(0, 100).'test'; | |
} | |
$results = array(); | |
for ($i=0; $i<1000; $i++) { | |
$results[] = get_cache_value(); | |
} | |
printf("Done in: %f s\n", microtime(true) - $start)."\n"; | |
printf("Memory used: %d KB\n", memory_get_peak_usage(true)/1024)."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Done in: 0.002922 s
Memory used: 256 KB