Skip to main content

RateLimiter

A class in Alta.Coroutines, Alta.Utilities.

Simple real-time rate limiter: construct it with a ticks-per-second target, then call IsRateLimited each frame. Used by QuestMarker.

Constructors​

MemberWhat it is
RateLimiter(float targetTickRate)Creates a RateLimiter from targetTickRate.

Fields​

2 private and internal fields
MemberWhat it is
private float limitReal time (Time.realtimeSinceStartup) before which calls are rate limited.
private readonly float targetTickRateSeconds between ticks (one over the ticks per second passed to the constructor).

Methods​

MemberWhat it is
bool IsRateLimited()Returns true until the next tick is due; when it returns false it schedules the next tick. Never limits if the rate is zero or less.

Used in​

Members of other types that take, return or hold a RateLimiter: