Last active
December 15, 2015 10:49
-
-
Save charltoons/5248676 to your computer and use it in GitHub Desktop.
This file contains 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 <stdio.h> /* printf, scanf, puts, NULL */ | |
#include <stdlib.h> /* srand, rand */ | |
#include <time.h> /* time */ | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
srand (time(NULL)); | |
cout << "Begin" << endl; | |
float startTime = (float)clock()/CLOCKS_PER_SEC; | |
//cout << startTime << endl; | |
for (int i=0; i<1000000000; i++) { | |
float rando1 = ((float) rand()) / 7; | |
float rando2 = ((float) rand()) / 7; | |
float rando = rando1 / rando2; | |
} | |
float endTime = (float)clock()/CLOCKS_PER_SEC; | |
float timeElapsed = endTime - startTime; | |
cout << "End" << endl; | |
cout << "Time Elpased: " << timeElapsed << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment