Moved time functions out of core