简体   繁体   中英

Is there a Java library for calculating elapsed time?

I am wondering if there is a library one can use that calculates elapsed time? Something like... if you pass it a long of milliseconds, you get a result like "2d 5h 12m 55s" (possibly even more formats similarly to SimpleDateFormatter ).

I've heard of jodatime, but I've never used it. Can it be used for such calculations, or are there other more appropriate libraries?

It's not like I can't knock up a few methods myself, but I find myself doing this every now and then and that's why I'm wondering if something like this already exists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM