How it works...
Step 1 takes care of including the headers we'll need later: <iostream> for the standard output and <vector> and <chrono> for the time.
Step 2 defines a vector of int called elements. Due to this, we can call the now() method on the system_clock class in the chrono namespace to get the current time. Although we used auto, this method returns a time_point object representing a point in time. Then, we looped over 100 million times to populate the elements array in order to highlight that we used the new C++14 feature to represent 100,000,000, which improves the readability of the code. At the end, we took another point in time by calling the now() method and storing the time_point object in the end variable.
In step 3, we looked ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access