mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
upd: optimize benchmark
This commit is contained in:
parent
6ca5d39a0c
commit
217bde2674
@ -83,14 +83,16 @@ void fmt_multi_fmt_float(benchmark::State &state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void imp_fmt_chrono(benchmark::State &state) {
|
void imp_fmt_chrono(benchmark::State &state) {
|
||||||
|
auto now = std::chrono::system_clock::now();
|
||||||
for (auto _ : state) {
|
for (auto _ : state) {
|
||||||
std::ignore = imp::fmt(std::chrono::system_clock::now());
|
std::ignore = imp::fmt(now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fmt_fmt_chrono(benchmark::State &state) {
|
void fmt_fmt_chrono(benchmark::State &state) {
|
||||||
|
auto now = std::chrono::system_clock::now();
|
||||||
for (auto _ : state) {
|
for (auto _ : state) {
|
||||||
std::ignore = fmt::format("{}", std::chrono::system_clock::now());
|
std::ignore = fmt::format("{}", now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user