Java TimeUnit Calculate getBucketInMillis(int bucketSize, TimeUnit bucketUnit)

Here you can find the source of getBucketInMillis(int bucketSize, TimeUnit bucketUnit)

Description

Returns the given bucket size and bucket unit to the bucket size in milliseconds.

License

Apache License

Parameter

Parameter Description
bucketSize the number of the units.
bucketUnit the unit for computing the bucket size in milliseconds.

Return

the bucket size in milliseconds.

Declaration

public static long getBucketInMillis(int bucketSize, TimeUnit bucketUnit) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    /**/*from   ww w . j a  v a 2 s  .  com*/
     * Returns the given bucket size and bucket unit to the bucket size in milliseconds.
     * @param bucketSize the number of the units.
     * @param bucketUnit the unit for computing the bucket size in milliseconds.
     * @return the bucket size in milliseconds.
     */
    public static long getBucketInMillis(int bucketSize, TimeUnit bucketUnit) {
        return bucketUnit.toMillis(bucketSize);
    }
}

Related

  1. deepSleep(long sleepFor, TimeUnit unit)
  2. delayQuietly(final long time, final TimeUnit unit)
  3. diff(Date earlier, Date later, TimeUnit timeUnit)
  4. differenceBetween(Date initDate, Date endDate, TimeUnit units)
  5. getBase(final TimeUnit unit)
  6. getComingTime(Integer delta, TimeUnit unit)
  7. getDate(final TimeUnit unit, final int offset)
  8. getDateDiff(Date date1, Date date2, TimeUnit timeUnit)
  9. getDateDiff(final Date d1, final Date d2, final TimeUnit timeUnit)