[#BloombergLP-balb-RateLimiter-2constructor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balb.adoc[balb]::xref:BloombergLP/balb/RateLimiter.adoc[RateLimiter]::RateLimiter
:relfileprefix: ../../../
:mrdocs:

Create a rate limiter with the specified rate limits and start time&period;

== Synopsis

Declared in `&lt;balb&lowbar;ratelimiter&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
RateLimiter(
    xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] sustainedRateLimit,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& sustainedRateWindow,
    xref:BloombergLP/bsls/Types/Uint64.adoc[bsls::Types::Uint64] peakRateLimit,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& peakRateWindow,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& currentTime);
----

== Description

Create a RateLimiter object, having the specified `sustainedRateLimit`, the specified `sustainedRateWindow`, the specified `peakRateLimit`, the specified `peakRateWindow`, and using the specified `currentTime` as the initial `lastUpdateTime`&period; The behavior is undefined unless `0 &lt; sustainedRateLimit`, `0 &lt; sustainedRateWindow`, `0 &lt; peakRateLimit`, `0 &lt; peakRateWindow`, the product of `sustainedRateLimit` and `sustainedRateWindow` can be represented by 64&hyphen;bit unsigned integral type, and the product of `peakRateLimit` and `peakRateWindow` can be represented by 64&hyphen;bit unsigned integral type&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sustainedRateLimit*
| sustained rate in units per second
| *sustainedRateWindow*
| sustained&hyphen;rate time&hyphen;window
| *peakRateLimit*
| peak rate in units per second
| *peakRateWindow*
| peak&hyphen;rate time&hyphen;window
| *currentTime*
| initial `lastUpdateTime` for this rate limiter
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
