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

Set the `lastUpdateTime` of this rate limiter to the specified `currentTime`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
updateState(xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& currentTime);
----

== Description

If the `currentTime` is after `lastUpdateTime`, then recalculate number of units available for consumption based on the `peakRate`, `sustainedRate` and the time interval between `lastUpdateTime` and `currentTime`&period; If `currentTime` is before `statisticsCollectionStartTime`, set it&apos; to `currentTime`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *currentTime*
| time to which this rate limiter&apos;s state is updated
|===


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