Here you can find the source of convertToMillis(long waitTime, TimeUnit timeUnit)
public static long convertToMillis(long waitTime, TimeUnit timeUnit)
//package com.java2s; /*/*from w ww .j a v a 2 s .c om*/ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ import java.util.concurrent.TimeUnit; public class Main { public static long convertToMillis(long waitTime, TimeUnit timeUnit) { return timeUnit.toMillis(waitTime); } }