Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <chrono>
  2.  
  3. uint64_t millis()
  4. {
  5. return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
  6. }
  7.  
  8. uint64_t micros()
  9. {
  10. return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();;
  11. }
  12.  
  13. uint64_t nanos()
  14. {
  15. return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement