cpp : disambiguated auto keyword

This commit is contained in:
saundersp
2023-07-15 03:35:31 +02:00
parent 4cd659ea8c
commit 18afd40782
5 changed files with 11 additions and 11 deletions

View File

@ -58,9 +58,9 @@ T benchmark_function(const char* step_name, const F& fnc, Args &&...args) noexce
printf("%s...\r", step_name);
fflush(stdout); // manual flush is mandatory, otherwise it will not be shown immediately because the output is buffered
#endif
const auto start = time();
const std::chrono::system_clock::time_point start = perf_counter_ns();
const T res = fnc(std::forward<Args>(args)...);
const long long timespent = duration_ns(time() - start);
const long long timespent = duration_ns(perf_counter_ns() - start);
printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(timespent).c_str(), format_time_ns(timespent).c_str());
return res;
}
@ -71,9 +71,9 @@ void benchmark_function_void(const char* step_name, const F& fnc, Args &&...args
printf("%s...\r", step_name);
fflush(stdout); // manual flush is mandatory, otherwise it will not be shown immediately because the output is buffered
#endif
const auto start = time();
const std::chrono::system_clock::time_point start = perf_counter_ns();
fnc(std::forward<Args>(args)...);
const long long timespent = duration_ns(time() - start);
const long long timespent = duration_ns(perf_counter_ns() - start);
printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(timespent).c_str(), format_time_ns(timespent).c_str());
}