title: C++ chrono Difference between 2 time clocks in seconds
body: <p>I want to find the difference between 2 time clocks using chrono library in seconds. I tried various ways, Following is one among them. All of them works fine till the difference is 59 seconds but times out after that. I really need the actual value of difference even if it is more than 59 seconds</p>
  
  <pre><code>#include &lt;iostream&gt;     
  #include &lt;chrono&gt;       
  #include &lt;thread&gt;                        
  
  int main ()
  {
      using std::chrono::system_clock;
     using std::chrono::milliseconds;
     using std::chrono::seconds;
     using std::chrono::duration_cast;
     const auto duration = milliseconds(1000);
     const auto start = system_clock::now();
  
     for(int i=0; i&lt;65; i++)
     {
         std::this_thread::sleep_for(duration);
     const auto stop = system_clock::now();
  
     const auto difference = std::chrono::duration_cast&lt;seconds&gt;(stop - start).count();
  
     std::cout &lt;&lt; "Difference is =&gt;" &lt;&lt; difference &lt;&lt; std::endl;
  
     }
  }
  </code></pre>
  
  <p>The above outputs the difference till 59 and times out after that. Whats going on wrong here?</p>