Code example for TimeUnit

Methods: toNanos

0
        this.duration = duration;
        this.timeUnit = timeUnit;
    } 
 
    public long nanos() { 
        return timeUnit.toNanos(duration);
    } 
 
    public long getNanos() { 
        return nanos(); 
    } 
 
    public long micros() { 
        return timeUnit.toMicros(duration);
    } 
 
    public long getMicros() { 
        return micros(); 
    } 
 
    public long millis() {