Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct timeit {
- decltype(chrono::high_resolution_clock::now()) begin;
- const string label;
- timeit(string label = "???") : label(label) { begin = chrono::high_resolution_clock::now(); }
- ~timeit() {
- auto end = chrono::high_resolution_clock::now();
- auto duration = chrono::duration_cast<chrono::milliseconds>(end - begin).count();
- cerr << duration << "ms elapsed [" << label << "]" << endl;
- }
- };
Add Comment
Please, Sign In to add comment