load("Excel2003XMLTest.xml"); $callEndTime = microtime(true); $callTime = $callEndTime - $callStartTime; echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , PHP_EOL; // Echo memory usage echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; echo date('H:i:s') , " Write to Excel5 format" , PHP_EOL; $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save(str_replace('.php', '.xls', __FILE__)); echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', __FILE__) , PHP_EOL; // Echo memory peak usage echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; // Echo done echo date('H:i:s') , " Done writing file" , PHP_EOL;