added lines to output latency to file