fork download
  1. #include <iostream>
  2. #include <chrono>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::chrono::milliseconds durationToCompare{2};
  7.  
  8. auto t1 = std::chrono::high_resolution_clock::now();
  9. auto t2 = std::chrono::high_resolution_clock::now();
  10.  
  11. std::cout << ((t1 - t2) >= durationToCompare) << '\n';
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5440KB
stdin
Standard input is empty
stdout
0