[#FastRandomContext-rand_exp_duration]
= xref:FastRandomContext.adoc[FastRandomContext]::rand&lowbar;exp&lowbar;duration
:relfileprefix: ../
:mrdocs:

Return a duration sampled from an exponential distribution (https&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Exponential&lowbar;distribution)&period; Successive events whose intervals are distributed according to this form a memoryless Poisson process&period; This should be used for repeated network events (e&period;g&period; sending a certain type of message) to minimize leaking information to observers&period;

== Synopsis

Declared in `&lt;random&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::chrono::microseconds
rand&lowbar;exp&lowbar;duration(std::chrono::microseconds mean) noexcept;
----

== Description

The probability of an event occurring before time x is 1 &hyphen; e&circ;&hyphen;(x&sol;a) where a is the average interval between events&period;

== Return Value

A duration sampled from an exponential distribution with the given mean&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *mean*
| The average interval between events&period;
|===


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