Timer Class In CPP or C++ For Benchmarking Use this Timer class in any namespace, destructor will be called once scope ends and prints the executaion time in mili and microsecond. Run code... Without optimization g++ -std=c++11 main.cpp -o main && ./main With optimization g++ -std=c++11 main.cpp -O3 -o main && ./main