Added explicit measurement of, and adaptation to, the time between frames.