Here you can find the source of getMilliseconds(int interval, TimeUnit unit)
public static long getMilliseconds(int interval, TimeUnit unit)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; import org.joda.time.DateTimeConstants; public class Main { public static long getMilliseconds(int interval, TimeUnit unit) { long millisPerUnit = 1; switch (unit) { case DAYS: millisPerUnit = DateTimeConstants.MILLIS_PER_DAY; break; case HOURS: millisPerUnit = DateTimeConstants.MILLIS_PER_HOUR; break; case MINUTES: millisPerUnit = DateTimeConstants.MILLIS_PER_MINUTE; break; case SECONDS: millisPerUnit = DateTimeConstants.MILLIS_PER_SECOND; break; default:/*from w w w . java 2 s .c om*/ break; } return interval * millisPerUnit; } }