Timing code redone to be a part of the simulation interface.