45#ifndef MICRO_TEST_PLUS_TIMINGS_H_
46#define MICRO_TEST_PLUS_TIMINGS_H_
61#pragma GCC diagnostic push
63#pragma clang diagnostic ignored "-Wc++98-compat"
64#pragma clang diagnostic ignored "-Wpre-c++17-compat"
159 [[nodiscard]] timespec&
169 [[nodiscard]] const timespec&
170 value () const noexcept;
327 uint32_t& microseconds) const;
347#pragma GCC diagnostic pop
A single point-in-time measurement, wrapping a timespec value.
~timestamp()=default
Defaulted destructor.
timestamp(const timestamp &)=default
Defaulted copy constructor.
timestamp() noexcept
Default constructor. Zero-initialises the internal timespec.
timespec & value() noexcept
Returns a mutable reference to the underlying timespec value.
timespec value_
The underlying timespec value.
timestamp(timestamp &&)=default
Defaulted move constructor.
timestamp & operator=(const timestamp &)=default
Defaulted copy assignment operator.
bool has_clock(void) const noexcept
Returns true if a monotonic clock is available on this target.
bool has_timestamps(void) const noexcept
Returns true if both begin and end timestamps are available.
void timestamp_begin(void) noexcept
Records the begin timestamp using the current system clock.
timestamps()=default
Default constructor. Both timestamps are uninitialised.
~timestamps()=default
Defaulted destructor.
bool has_end() const noexcept
Returns true if the end timestamp has been recorded.
void compute_elapsed_time(uint32_t &milliseconds, uint32_t µseconds) const
Computes the elapsed time between begin and end timestamps.
std::optional< timestamp > end_time_
The timestamp recorded at the end of the test suite.
timestamps & operator=(const timestamps &)=delete
Deleted copy assignment operator to prevent copying.
bool has_begin() const noexcept
Returns true if the begin timestamp has been recorded.
std::optional< timestamp > begin_time_
The timestamp recorded at the beginning of the test suite.
timestamps(const timestamps &)=delete
Deleted copy constructor to prevent copying.
void timestamp_end(void) noexcept
Records the end timestamp using the current system clock.
timestamps(timestamps &&)=delete
Deleted move constructor to prevent moving.
Internal implementation details for the µTest++ framework.
Primary namespace for the µTest++ testing framework.
C++ header file with inline implementations for the µTest++ timing utilities.