SHARE
TWEET

Untitled

a guest Jan 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <chrono>
  3. #include <ctime>    
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.     int distanza;
  9.     cin >> distanza;
  10.    
  11.     auto start = chrono::system_clock::now();
  12.     auto end = chrono::system_clock::now();
  13.  
  14.     chrono::duration<double> elapsed_seconds = end-start;
  15.     time_t end_time = chrono::system_clock::to_time_t(end);
  16.  
  17.    
  18.     cout << "finished computation at " << ctime(&end_time)
  19.               << "Distanza percorsa:\t" << distanza
  20.                    << "\nIntervallo di tempo: " << elapsed_seconds.count() << "s\n";
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top