Created
August 13, 2019 09:26
-
-
Save huihut/4ef464beb26d75628aabab2db70a2bf7 to your computer and use it in GitHub Desktop.
Statistical program running time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<time.h> | |
using namespace std; | |
int main() | |
{ | |
clock_t startTime,endTime; | |
startTime = clock(); | |
for (int i = 0; i < 1000000; i++) | |
{ | |
i++; | |
} | |
endTime = clock(); | |
cout << "Totle Time : " <<(double)(endTime - startTime) / CLOCKS_PER_SEC << "s" << endl; | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment