Add timing logic (untested).