-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (25 loc) · 820 Bytes
/
main.cpp
File metadata and controls
29 lines (25 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cstdlib> // For rand(), srand()
#include <ctime> // For time()
#include "profiler.h"
#include "sorting.h"
int generateRandomInt(int min, int max) {
// Seed the random number generator only once
static bool seeded = false;
if (!seeded) {
srand(time(NULL));
seeded = true;
}
return min + (rand() % (max - min + 1));
}
int main(int argc, char **argv) {
std::vector<int> arr;
// Generate our randomly unsorded integers array
for (int i = 0; i < 10000000; i++)
arr.push_back(generateRandomInt(0, 10000000));
std::cout << "Hello from main!" << std::endl;
startProfiling(); // Call a function from profiler.cpp
// ... your main program logic ...
stopProfiling(); // Call a function from profiler.cpp
return 0;
}