Java Duration to toMicro(Duration duration)

Here you can find the source of toMicro(Duration duration)

Description

to Micro

License

Open Source License

Declaration

public static BigInteger toMicro(Duration duration) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigInteger;

import java.time.Duration;

public class Main {
    private static final BigInteger micromult = new BigInteger("1000000");

    public static BigInteger toMicro(Duration duration) {
        BigInteger ret = BigInteger.valueOf(duration.getSeconds());
        ret = ret.multiply(micromult);//from ww  w  .j a  va  2  s.  co m
        ret = ret.add(BigInteger.valueOf(duration.getNano() / 1000));
        return ret;
    }
}

Related

  1. durationToFloat(Duration duration)
  2. durationToString(Duration d)
  3. toDuration(Long unixTime)
  4. toDuration(String durationString)
  5. toSeconds(final Duration time)
  6. toTicks(Duration duration)
  7. toUnit(TemporalUnit unit, Duration duration)