Example code: https://github.com/PacktPublishing/Hands-On-Design-Patterns-with-CPP/tree/master/Chapter06 Google Benchmark library: https://github.com/google/benchmark (see Chapter 4, Swap - From Simple to Subtle)