Move time functions to monitor.h.