mirror of
https://github.com/google/benchmark.git
synced 2024-12-29 14:00:16 +08:00
Make DateTimeString part of the internal implementation
This commit is contained in:
parent
b07fee6b64
commit
cfa3e181ab
@ -207,6 +207,8 @@ WallTime Now()
|
|||||||
} // end namespace walltime
|
} // end namespace walltime
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
std::string DateTimeString(bool local) {
|
std::string DateTimeString(bool local) {
|
||||||
typedef std::chrono::system_clock Clock;
|
typedef std::chrono::system_clock Clock;
|
||||||
std::time_t now = Clock::to_time_t(Clock::now());
|
std::time_t now = Clock::to_time_t(Clock::now());
|
||||||
@ -225,4 +227,10 @@ std::string DateTimeString(bool local) {
|
|||||||
return std::string(storage);
|
return std::string(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // end namespace
|
||||||
|
|
||||||
|
std::string LocalDateTimeString() {
|
||||||
|
return DateTimeString(true);
|
||||||
|
}
|
||||||
|
|
||||||
} // end namespace benchmark
|
} // end namespace benchmark
|
||||||
|
@ -10,11 +10,7 @@ namespace walltime {
|
|||||||
WallTime Now();
|
WallTime Now();
|
||||||
} // end namespace walltime
|
} // end namespace walltime
|
||||||
|
|
||||||
std::string DateTimeString(bool local = false);
|
std::string LocalDateTimeString();
|
||||||
|
|
||||||
inline std::string LocalDateTimeString() {
|
|
||||||
return DateTimeString(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end namespace benchmark
|
} // end namespace benchmark
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user