Most idiomatic way to print a time difference in Java?
- by Zombies
I'm familiar with printing time difference in milliseconds:
long time = System.currentTimeMillis();
//do something that takes some time...
long completedIn = System.currentTimeMillis() - time();
But, is there a nice way print a complete time in a specified format (eg: HH:MM:SS) either using Apache Commons or even the dreaded platform API's Date/Time objects? In other words, what is the shortest, simplest, no nonsense way to write this in Java?