Split the code for computing frame rate and latency into a separate file so we can use it from multiple tests.