Encapsulated the timing logic in a central class. Modified other code to
make used of the centralised timing and logging.