Skip to content

Instantly share code, notes, and snippets.

@srz-zumix
Created April 22, 2019 04:50
Show Gist options
  • Select an option

  • Save srz-zumix/6ace2c2214ae72bc99d92913e6485f03 to your computer and use it in GitHub Desktop.

Select an option

Save srz-zumix/6ace2c2214ae72bc99d92913e6485f03 to your computer and use it in GitHub Desktop.
// https://wandbox.org/permlink/DnmwABiHeYne8Iaz
#include <iostream>
#include <cstdlib>
#include <boost/timer/timer.hpp>
int main()
{
const long n=10000000;
{
boost::timer::cpu_timer timer;
for (long i = 0; i < n; ++i) {
// DO 1
}
std::string result = timer.format();
std::cout << result << std::endl;
}
{
boost::timer::cpu_timer timer;
for (long i = 0; i < n; ++i) {
// DO 2
}
std::string result = timer.format();
std::cout << result << std::endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment