Move some time functions to a cpp file