Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include<iostream>
  2. #include<ctime>
  3. #include<cstdlib>
  4. #include<cstdio>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     time_t t1=time(0);
  11.     cout<<"Press any key to measure the time difference:\n";
  12.     getchar();
  13.     time_t t2=time(0);
  14.     int t=t2-t1;
  15.     cout<<endl<<endl;
  16.     cout<<"Time gap between program run and your key press is:\n"<<t<<" sec\n";
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement