Does anyone know of a Java library that can pretty print a number in milliseconds in the same way that C# does?
E.g., 123456 ms as a long would be printed as 4d1h3m5
I realize this might not fit your use case exactly, but PrettyTime might be useful here.
PrettyTime p = new PrettyTime(); System.out.println(p.format(new Date())); //prints: “right now” System.out.println(p.format(new Date(1000*60*10))); //prints: “10 minutes from now”