-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
28 lines (22 loc) · 871 Bytes
/
main.cpp
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
#include <iostream>
#include <chrono>
#include "include/sorting_library.h"
int main() {
//make some data to sort
int data[50];
for (int i = 0; i < 50; i++)
data[i] = i;
std::cout << std::fixed << std::showpoint;
std::cout.precision(9);
print_version_number();
//create a start and end time_point object
std::chrono::time_point<std::chrono::high_resolution_clock> start, end;
//get the current time, run the algo, then get the current time again
start = std::chrono::high_resolution_clock::now();
mystery03(data, 50);
end = std::chrono::high_resolution_clock::now();
//calculate the duration between start and end and print to the terminal
std::chrono::duration<double> time_in_seconds = end - start;
std::cout << std::fixed << "Duration: " << time_in_seconds.count() << std::endl;
return 0;
}