Skip to content

Instantly share code, notes, and snippets.

@cherichy

cherichy/TIMER.h

Last active Jan 29, 2020
Embed
What would you like to do?
Marco for timer of high accuracy
#include <chrono>
#define TIMER(Run) [&](){\
auto t1 = std::chrono::system_clock::now();\
auto res = Run;\
auto t2 = std::chrono::system_clock::now();\
auto dt = std::chrono::duration_cast<std::chrono::milliseconds>(t2-t1).count();\
std::cout << #Run << " elapsed time: " << dt << "ms" << std::endl;\
return res;\
}()
@pagesys

This comment has been minimized.

Copy link

@pagesys pagesys commented Jan 29, 2020

God Chi is so power B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment