Add Time struct, modify Clock and improve a few bottlenecks.