19 #include "benchmark/benchmark.h" 24 const char*
const kFormats[] = {
32 const int kNumFormats =
sizeof(kFormats) /
sizeof(kFormats[0]);
35 void BM_Format_FormatTime(benchmark::State& state) {
36 const std::string fmt = kFormats[state.range(0)];
43 while (state.KeepRunning()) {
47 BENCHMARK(BM_Format_FormatTime)->DenseRange(0, kNumFormats - 1);
49 void BM_Format_ParseTime(benchmark::State& state) {
50 const std::string fmt = kFormats[state.range(0)];
58 while (state.KeepRunning()) {
62 BENCHMARK(BM_Format_ParseTime)->DenseRange(0, kNumFormats - 1);
const char RFC1123_no_wday[]
std::string FormatTime(const std::string &format, absl::Time t, absl::TimeZone tz)
const char RFC3339_full[]
bool ParseTime(const std::string &format, const std::string &input, absl::Time *time, std::string *err)
Time FromCivil(CivilSecond ct, TimeZone tz)
const char RFC1123_full[]
TimeZone LoadTimeZone(const std::string &name)
constexpr Duration Nanoseconds(int64_t n)