liveBook · Manning

Std::chrono::minutes

As explained in Learn C++ by Example

A chrono minute is a standard duration type representing a time interval measured in minutes.

std::chrono::minutes represents a duration measured in minutes, using a 60:1 ratio. It fits alongside hours, seconds, milliseconds, and other chrono duration types. section 4.2.2

Table 4.1 Two ways to define a specific duration (view table figure)

Duration

Literals example

hours{12}

12h

minutes{34}

34min

seconds{1}

1s

millisecond{1}

1ms

microsecond{1}

1us

nanosecond{1}

1ns

Compare the explicit form minutes{34} with the readable chrono literal 34min. section 4.2.3

Use the explicit type when naming or initializing a duration directly. Use the min suffix when chrono literals are enabled; these literals were introduced in C++11. section 4.2.3

How Learn C++ by Example covers it

How deep it goes
Defines the minute ratio and syntax, while placing conversions and precision loss within the broader duration system.
Examples
Shows minutes{34} and 34min as equivalent ways to specify a 34-minute duration.
What you can do after
Apply it via std::chrono to construct minute-based durations in explicit or literal form.
How it connects
Connects durations with duration_cast, chrono literals, and other standard duration units.

This explainer was generated by Manning's knowledge graph from the text of Learn C++ by Example. The section links point to the parts of the book it draws on.