Here you can find the source of getBucketInMillis(int bucketSize, TimeUnit bucketUnit)
Parameter | Description |
---|---|
bucketSize | the number of the units. |
bucketUnit | the unit for computing the bucket size in milliseconds. |
public static long getBucketInMillis(int bucketSize, TimeUnit bucketUnit)
//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); } }