Added optional elapsed time output.