Java TimeUnit Convert convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt)

Here you can find the source of convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt)

Description

convert

License

Open Source License

Declaration

public static long convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt) 

Method Source Code

//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);
    }
}

Related

  1. convert(double t, TimeUnit sourceUnit, TimeUnit destinationUnit)
  2. convert(long time, TimeUnit src, TimeUnit dst)
  3. convert(long time, TimeUnit unitIn, TimeUnit unitOut)
  4. convertReportingPeriod(long profilePeriod, TimeUnit profileTimeUnit, long reportingPeriod, TimeUnit reportingTimeUnit)
  5. convertTo(long a, TimeUnit from, TimeUnit to)
  6. convertToDouble(long fromTime, TimeUnit fromTimeUnit, TimeUnit toTimeUnit)
  7. convertToMillis(long waitTime, TimeUnit timeUnit)