February 2020
Intermediate to advanced
292 pages
8h 54m
English
First of all, let's compile and execute the program:

We can immediately notice that the real-time clock (seconds) is way bigger than the monotonic clock (seconds). By doing some math, you'll notice that the first is about 49 years and the latter is about 12 hours. Why is that? The second observation is that our code took 1 second and 644348500 nanoseconds to populate a vector of 100 million items. Let's gather some insights to explain this.
Step 1 just adds some includes and the prototype we've written to calculate the time difference.
Step 2 defined two variables, struct timespec tsRealTime and struct timespec tsMonotonicStart ...
Read now
Unlock full access