Java TimeUnit Convert convert(long time, TimeUnit unitIn, TimeUnit unitOut)

Here you can find the source of convert(long time, TimeUnit unitIn, TimeUnit unitOut)

Description

convert

License

Apache License

Declaration

private static double convert(long time, TimeUnit unitIn, TimeUnit unitOut) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.concurrent.TimeUnit;

public class Main {
    private static double convert(long time, TimeUnit unitIn, TimeUnit unitOut) {
        return (double) unitIn.toNanos(time) / (double) unitOut.toNanos(1);
    }/*from  w w w. j a  v  a2s  . c o  m*/
}

Related

  1. convert(double t, TimeUnit sourceUnit, TimeUnit destinationUnit)
  2. convert(long time, TimeUnit src, TimeUnit dst)
  3. convert(TimeUnit unitTo, TimeUnit unitFrom, long cnt)
  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)