aboutsummaryrefslogtreecommitdiff
path: root/src/bench/bench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bench/bench.cpp')
-rw-r--r--src/bench/bench.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp
index 9bd176f0a0..033d319750 100644
--- a/src/bench/bench.cpp
+++ b/src/bench/bench.cpp
@@ -8,6 +8,7 @@
#include <test/util/setup_common.h>
#include <chrono>
+#include <fstream>
#include <functional>
#include <iostream>
#include <map>
@@ -23,20 +24,19 @@ const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS{};
namespace {
-void GenerateTemplateResults(const std::vector<ankerl::nanobench::Result>& benchmarkResults, const std::string& filename, const char* tpl)
+void GenerateTemplateResults(const std::vector<ankerl::nanobench::Result>& benchmarkResults, const fs::path& file, const char* tpl)
{
- if (benchmarkResults.empty() || filename.empty()) {
+ if (benchmarkResults.empty() || file.empty()) {
// nothing to write, bail out
return;
}
- fsbridge::ofstream fout{fs::PathFromString(filename)};
+ std::ofstream fout{file};
if (fout.is_open()) {
ankerl::nanobench::render(tpl, benchmarkResults, fout);
+ std::cout << "Created " << file << std::endl;
} else {
- std::cout << "Could write to file '" << filename << "'" << std::endl;
+ std::cout << "Could not write to file " << file << std::endl;
}
-
- std::cout << "Created '" << filename << "'" << std::endl;
}
} // namespace