Last active
November 18, 2017 07:18
-
-
Save takuzoo3868/720ca3f9c619c2eb2823721642a9506c to your computer and use it in GitHub Desktop.
🕒 Processing time measurement template for competition programming
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 <iostream> | |
#include <chrono> | |
using namespace std; | |
int main() { | |
// 計測開始時刻を保存 | |
auto start = std::chrono::system_clock::now(); | |
/* | |
* 処理 | |
*/ | |
// 計測終了時刻の保存 | |
auto end = std::chrono::system_clock::now(); | |
// 処理時間の計算 | |
auto dur = end - start; | |
auto micro = std::chrono::duration_cast<std::chrono::microseconds>(dur).count(); | |
// マイクロ秒単位で表示 | |
std::cout << micro << " micro sec \n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment