Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- #include<cstdlib>
- #include<cstdio>
- using namespace std;
- int main()
- {
- time_t t1=time(0);
- cout<<"Press any key to measure the time difference:\n";
- getchar();
- time_t t2=time(0);
- int t=t2-t1;
- cout<<endl<<endl;
- cout<<"Time gap between program run and your key press is:\n"<<t<<" sec\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement