Use more accurate conversion from seconds to milliseconds