26#if defined(STAT_BENCH_DOCUMENTATION)
31#define STAT_BENCH_HAS_WIN_MONOTONE_CLOCK 1
33#elif defined(__unix__)
34#define STAT_BENCH_HAS_UNIX_MONOTONE_CLOCK 1
43#if defined(STAT_BENCH_DOCUMENTATION) || \
44 defined(STAT_BENCH_HAS_WIN_MONOTONE_CLOCK)
51class WinMonotoneTimePoint {
60 const WinMonotoneTimePoint& right)
const noexcept ->
Duration;
67 [[nodiscard]]
static auto now() noexcept -> WinMonotoneTimePoint;
78 using DataType =
std::int64_t;
85 explicit WinMonotoneTimePoint(DataType data) noexcept;
93#if defined(STAT_BENCH_DOCUMENTATION) || \
94 defined(STAT_BENCH_HAS_UNIX_MONOTONE_CLOCK)
101class UnixMonotoneTimePoint {
110 const UnixMonotoneTimePoint& right)
const noexcept ->
Duration;
117 [[nodiscard]]
static auto now() noexcept -> UnixMonotoneTimePoint;
128 using DataType = timespec;
135 explicit UnixMonotoneTimePoint(DataType data) noexcept;
149class StdMonotoneTimePoint {
158 const StdMonotoneTimePoint& right)
const noexcept ->
Duration;
165 [[nodiscard]]
static auto now()
noexcept -> StdMonotoneTimePoint;
176 using DataType = std::chrono::steady_clock::time_point;
183 explicit StdMonotoneTimePoint(DataType data)
noexcept;
189#if defined(STAT_BENCH_DOCUMENTATION)
192#elif defined(STAT_BENCH_HAS_WIN_MONOTONE_CLOCK)
195#elif defined(STAT_BENCH_HAS_UNIX_MONOTONE_CLOCK)
Class of time points of the monotone clock in C++ standard library.
auto operator-(const StdMonotoneTimePoint &right) const noexcept -> Duration
Calculate a duration between two time points.
static auto now() noexcept -> StdMonotoneTimePoint
Get the current time from the monotone clock.
static auto resolution() noexcept -> Duration
Get the resolution of the monotone clock.
Class of time points of the monotone clock in Unix.
static auto resolution() noexcept -> Duration
Get the resolution of the monotone clock.
static auto now() noexcept -> UnixMonotoneTimePoint
Get the current time from the monotone clock.
auto operator-(const UnixMonotoneTimePoint &right) const noexcept -> Duration
Calculate a duration between two time points.
Class of time points of the monotone clock in Windows.
static auto resolution() noexcept -> Duration
Get the resolution of the monotone clock.
static auto now() noexcept -> WinMonotoneTimePoint
Get the current time from the monotone clock.
auto operator-(const WinMonotoneTimePoint &right) const noexcept -> Duration
Calculate a duration between two time points.
Definition of Duration class.
Namespace of clocks for benchmarks.
< platform_dependent_type > MonotoneTimePoint
Type of the monotone clock to use.
Namespace of stat_bench source codes.