Answers for "c++ measure time in microseconds"

C++
0

c++ measure time in microseconds

auto start = std::chrono::high_resolution_clock::now();
...
auto elapsed = std::chrono::high_resolution_clock::now() - start;

long long microseconds = std::chrono::duration_cast<std::chrono::microseconds>(elapsed).count();
Posted by: Guest on March-08-2021

Browse Popular Code Answers by Language