Created
December 14, 2017 13:24
-
-
Save Trass3r/289392e06f9036b2ac67e8a3f10a21cc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| struct MeasureAndPrintTime | |
| { | |
| std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); | |
| ~MeasureAndPrintTime() | |
| { | |
| auto diff = std::chrono::steady_clock::now() - start; | |
| auto usecs = std::chrono::duration_cast<std::chrono::microseconds>(diff).count(); | |
| printf("took %lldus\n", (long long)usecs); | |
| } | |
| } _dummy; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment