Created
April 24, 2020 03:32
-
-
Save syohex/75bc2108241036cbbc07350975771de4 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
#include <chrono> | |
#include <iostream> | |
int main() { | |
struct timespec n; | |
for (int i = 0; i < 20; ++i) { | |
auto now = std::chrono::system_clock::now(); | |
auto now_ns = std::chrono::time_point_cast<std::chrono::nanoseconds>(now); | |
std::cout << "current nano: " << now_ns.time_since_epoch().count() << std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment