Here you can find the source of convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt)
public static long convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static long convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt) { return unitTo .convert(unitFrom.toMillis(cnt), TimeUnit.MILLISECONDS); }/*from w w w.j av a 2 s . co m*/ public static long toMillis(TimeUnit unit, long duration) { return unit.toMillis(duration); } }