Skip to content

Commit 5097b3c

Browse files
committed
Removed commented section and added const to timer message parameter
1 parent edb4fc8 commit 5097b3c

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

C++/include/aoc_timer.hpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,6 @@ void timer(int part, F func, Args &&...args) {
4444
std::cout << std::format("Part {} answer: {:<20}{:>20}\n", part, result, duration_string);
4545
}
4646

47-
// template <typename T, typename U>
48-
// void timer(int part, T (*func)(const U &), U data, bool show_res = true) {
49-
// auto t1 = Clock::now();
50-
// T result = func(data);
51-
// auto t2 = Clock::now();
52-
53-
// const std::string duration_string = convert_duration(t2 - t1);
54-
// if (show_res) {
55-
// std::cout << std::format("Part {} answer: {:<20}{:>20}\n", part, result, duration_string);
56-
// } else {
57-
// std::cout << std::format("Time elapsed : {:>40}\n", duration_string);
58-
// }
59-
// }
60-
61-
// template <typename T, typename U, typename W>
62-
// void timer(int part, T (*func)(U &, W), U data, W data2, bool show_res = true) {
63-
// auto t1 = Clock::now();
64-
// T result = func(data, data2);
65-
// auto t2 = Clock::now();
66-
// const std::string duration_string = convert_duration(t2 - t1);
67-
// if (show_res) {
68-
// std::cout << std::format("Part {} answer: {:<20}{:>20}\n", part, result, duration_string);
69-
// } else {
70-
// std::cout << std::format("Time elapsed : {:>40}\n", duration_string);
71-
// }
72-
// }
73-
7447
template <typename F, typename U>
7548
void timer(F func, U data) {
7649
auto t1 = Clock::now();
@@ -82,7 +55,7 @@ void timer(F func, U data) {
8255
}
8356

8457
template <typename F, typename U>
85-
decltype(auto) timer(F func, U data, std::string &&message) {
58+
decltype(auto) timer(F func, U data, const std::string &&message) {
8659
auto t1 = Clock::now();
8760
auto result = func(data);
8861
auto t2 = Clock::now();

0 commit comments

Comments
 (0)