Added tests for timekeeping functions.
Added timekeeping functions to pass tests.