Use writeMilliseconds for more control precision