Generate a uniform random duration in the range from 0 (inclusive) to range (exclusive).

Synopsis

Declared in <random.h>

template<typename Chrono>
requires StdChronoDuration<typename Chrono::duration>
Chrono::duration
rand_uniform_duration(Chrono::duration range) noexcept;

Return Value

A uniform random duration in [0, range) (or (range, 0]when range is negative).

Parameters

Name

Description

range

The signed bound on the duration; the result lies between 0 and range.

Created with MrDocs