Time and Random Numbers
Measuring Time with <chrono>
Most programs need to know how long a given task takes. The header <chrono> provides tools for precisely and portably obtaining such values. There is a clock, w…
Durations and Time Points
A duration is a number of ticks of some fixed period. A time point is a specific point in time related to the beginning of some clock. Together, these make up t…
Random Number Engines
A random number engine is an object that produces a sequence of pseudorandom numbers of unsigned type. It remembers an internal state and advances the state to…
Random Distributions
A random number engine generates raw unsigned integers over its full domain. A distribution then takes these raw values and generates numbers of a particular sh…
Seeding Random Generators
When no seed is provided to a generator, the generator is started with some fixed value, and the exact same sequence will be generated on each execution. This f…
Why rand() Should Usually Be Avoided
The C library function rand() has been around for decades, yet it still has several serious limitations which prevent it from being a viable choice for new code…