Skip to content

Instantly share code, notes, and snippets.

@charltoons
Last active December 15, 2015 10:49
Show Gist options
  • Save charltoons/5248676 to your computer and use it in GitHub Desktop.
Save charltoons/5248676 to your computer and use it in GitHub Desktop.
#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