Last active
February 22, 2024 12:22
-
-
Save cherichy/4a7ebd71c7b3c479afb7834bccc89ecd to your computer and use it in GitHub Desktop.
Marco for timer of high accuracy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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;\ | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
God Chi is so power B