Guest User

Untitled

a guest
Feb 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. myfunc(10ms);
  2. myfunc(3h);
  3.  
  4. void myFunc(const std::chrono::duration<double, std::ratio<1, 1>>& duration)
  5. {
  6. std::cout << "duration is: " << duration.count() << std::endl;
  7. }
  8.  
  9. int main(int argc, const char * argv[])
  10. {
  11. myFunc(1ms);
  12. myFunc(1s);
  13. myFunc(1min);
  14. myFunc(1h);
  15.  
  16. system("pause");
  17. }
  18.  
  19. duration is: 0.001
  20. duration is: 1
  21. duration is: 60
  22. duration is: 3600
Add Comment
Please, Sign In to add comment