[#BloombergLP-balb-LeakyBucket-calculateDrainTime] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::xref:BloombergLP/balb/LeakyBucket.adoc[LeakyBucket]::calculateDrainTime :relfileprefix: ../../../ :mrdocs: Return the time interval required to drain the specified `numUnits` at the specified `drainRate`, round up the number of nanoseconds in the time interval if the specified `ceilFlag` is set to `true`, otherwise, round down the number of nanoseconds. The behavior is undefined unless the number of seconds in the calculated interval may be represented by a 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] calculateDrainTime( xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] numUnits, xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] drainRate, bool ceilFlag); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#