Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!file_exists('foo.dat')) {
- /* If the file to be read from disk doesn't exist create it */
- file_put_contents('foo.dat', str_repeat(0x00,1024*1024*10));
- }
- if (ini_get('output_buffering')) die('Please turn off output buffering...');
- $mem_start = memory_get_usage(); /* Store the memory usage here */
- readfile('foo.dat'); /* Read the file into output */
- $mem_end = memory_get_usage(); /* Store the memory usage here */
- $mem_peak = memory_get_peak_usage();
- echo "<pre>Memory started at: $mem_start\nMemory ended at: $mem_end\nMemory peaked at: $mem_peak</pre>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment