Java TimeUnit Calculate checkTimeUnit(TimeUnit timeUnit)

Here you can find the source of checkTimeUnit(TimeUnit timeUnit)

Description

check Time Unit

License

Apache License

Declaration

static void checkTimeUnit(TimeUnit timeUnit) 

Method Source Code


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

import java.util.concurrent.TimeUnit;

public class Main {
    static void checkTimeUnit(TimeUnit timeUnit) {
        if (timeUnit == TimeUnit.NANOSECONDS || timeUnit == TimeUnit.MICROSECONDS) {
            throw new IllegalArgumentException("Milliseconds is the lowest permitted time unit!");
        }/*from  w ww  .  j  av  a2s. c  om*/
    }
}

Related

  1. between(final Calendar calendar1, final Calendar calendar2, final TimeUnit scale)
  2. calculateDateDiff(Date date1, Date date2, TimeUnit timeUnit)
  3. calculateDelatBasedOnRate(int rateLimit, TimeUnit periodUnit, int period, TimeUnit resultingTimeUnit)
  4. calculateTimeout(long timeout, TimeUnit timeUnit)
  5. checkTime(long time, TimeUnit timeunit)
  6. createEquidistantDates(Calendar reference, final int periods, final TimeUnit sampleUnit, final int sampleRate, Calendar calendar)
  7. dateDifference(Date date1, Date date2, TimeUnit timeUnit)
  8. dateIn(long distance, TimeUnit unit)
  9. deepSleep(long sleepFor, TimeUnit unit)