Ever needed a utility which converts from one unit of time to another?
Well with Java 5 and higher, you won’t have to create your own conversion routine any longer.
Say for example you wanted to specify a value in seconds but the method you need to call expects a value in milliseconds (which is a common thing in Java).
Then this would be how you can convert the value with the java.util.concurrent.TimeUnit utility.
long oneMinute = TimeUnit.SECONDS.toMillis(60);