-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.cpp
More file actions
42 lines (34 loc) · 1.07 KB
/
Copy pathcheck.cpp
File metadata and controls
42 lines (34 loc) · 1.07 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using tp = chrono::high_resolution_clock::time_point;
void printCurrentTime() {
time_t t = time(nullptr);
tm* now = localtime(&t);
int hour = now->tm_hour % 12;
hour = hour ? hour : 12; // handle midnight case
cout << "Last Run Time reporting : ";
cout << hour << ':'
<< (now->tm_min < 10 ? "0" : "") << now->tm_min
<< (now->tm_hour >= 12 ? " PM" : " AM") << endl << endl;
}
void printRuntime(tp start, tp end) {
cout << endl;
chrono::duration<double> duration = end - start;
cout << fixed << setprecision(6);
cout << "Runtime: " << duration.count() << " seconds" << endl;
}
void program() {
cout << "this is want i want" << endl;
}
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
printCurrentTime();
auto start = chrono::high_resolution_clock::now();
program();
auto end = chrono::high_resolution_clock::now();
printRuntime(start, end);
return 0;
}