prints time periodically