Return a duration sampled from an exponential distribution (https://en.wikipedia.org/wiki/Exponential_distribution). Successive events whose intervals are distributed according to this form a memoryless Poisson process. This should be used for repeated network events (e.g. sending a certain type of message) to minimize leaking information to observers.
Declared in <random.h>
std::chrono::microseconds
rand_exp_duration(std::chrono::microseconds mean) noexcept;
The probability of an event occurring before time x is 1 - e^-(x/a) where a is the average interval between events.
A duration sampled from an exponential distribution with the given mean.
| Name | Description |
|---|---|
| mean | The average interval between events. |