Timer is important for measuring speed-ups or elapsed time for custom algorithms. We used to import <ctime> and measure time with:

However, clock() measures CPU time, not actual time elapsed (which may be much greater) according to this StackOverFlow. Hence, here provides my code snippets to measure execution time in C++ as a DebugTimer Class….