Using Chrono to measure time

Boost Chrono is a library for time calculations having some overlapping functionality with the Posix Time part of the Date Time library. Like Posix Time, Chrono too uses the notion of time points and durations. Chrono does not deal with dates. It is a newer library than Date Time, and implements the facilities proposed in a paper from the C++ Standards Committee working group (WG21). Parts of that proposal made it to the C++11 Standard Library as the Chrono library, and much of the discussion on Boost Chrono also applies to Chrono Standard Library (std::chrono).


A duration represents an interval of time. The duration has a numeric magnitude and must be expressed in units of time. The boost::chrono::duration ...

Get Learning Boost C++ Libraries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.