Skip to content

Instantly share code, notes, and snippets.

@yknishidate
Created April 5, 2022 01:59
Show Gist options
  • Save yknishidate/b12070e5c142361ef1b0fcca5a83dfdb to your computer and use it in GitHub Desktop.
Save yknishidate/b12070e5c142361ef1b0fcca5a83dfdb to your computer and use it in GitHub Desktop.
#include <chrono>
struct Timer
{
void start()
{
startTime = std::chrono::steady_clock::now();
}
long long elapsed()
{
auto endTime = std::chrono::steady_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count();
}
std::chrono::steady_clock::time_point startTime;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment