public final class NanoTimeTokenBucket extends TokenBucket
TokenBucket
that uses System.nanoTime
as the time source.Constructor and Description |
---|
NanoTimeTokenBucket(long _cap,
long _period) |
Modifier and Type | Method and Description |
---|---|
long |
currentTime()
The current time in nanos.
|
init, offer
public long currentTime()
TokenBucket
currentTime
in class TokenBucket