I'm recording the duration of how long something takes in Java. To do that, I'm running:
long startTime = System.nanoTime();
...
long duration = System.nanoTime() - startTime;
Now, I would like to take the duration and print it out in a format of mm:ss.SSS
. How do I do that in Java?