[#BloombergLP-balb-LeakyBucket-calculateTimeWindow] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::xref:BloombergLP/balb/LeakyBucket.adoc[LeakyBucket]::calculateTimeWindow :relfileprefix: ../../../ :mrdocs: Return the time interval over which a leaky bucket _approximates_ a moving‐total of submitted units, as the rounded‐down ratio between the specified `capacity` and the specified `drainRate`. If the rounded ratio is 0, return a time interval of 1 nanosecond. The behavior is undefined unless `drainRate > 0` and `capacity / drainRate` can be represented with 64‐bit signed integral type. == Synopsis Declared in `<balb_leakybucket.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] calculateTimeWindow( xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] drainRate, xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] capacity); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#