Skip to content

Instantly share code, notes, and snippets.

@huihut
Created August 13, 2019 09:26
Show Gist options
  • Save huihut/4ef464beb26d75628aabab2db70a2bf7 to your computer and use it in GitHub Desktop.
Save huihut/4ef464beb26d75628aabab2db70a2bf7 to your computer and use it in GitHub Desktop.
Statistical program running time
#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