Here you can find the source of convert(long time, TimeUnit unitIn, TimeUnit unitOut)
private static double convert(long time, TimeUnit unitIn, TimeUnit unitOut)
//package com.java2s; //License from project: Apache License import java.util.concurrent.TimeUnit; public class Main { private static double convert(long time, TimeUnit unitIn, TimeUnit unitOut) { return (double) unitIn.toNanos(time) / (double) unitOut.toNanos(1); }/*from w w w. j a v a2s . c o m*/ }