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