Added code to measure how far behind the event thread is.