optimized time print function