cpu_timer::start, cpu_timer::stop methods marked noexcept

These methods do not throw, and marking them noexcept explicitly
makes it fine to call them from other noexcept methods, as such
cleanup_noexcept in measure_cold.
This commit is contained in:
Oleksandr Pavlyk
2026-05-12 14:51:32 -05:00
parent 390c919995
commit 92e7c63f90

View File

@@ -45,9 +45,9 @@ struct cpu_timer
cpu_timer &operator=(const cpu_timer &) = delete;
cpu_timer &operator=(cpu_timer &&) = default;
__forceinline__ void start() { m_start = std::chrono::high_resolution_clock::now(); }
__forceinline__ void start() noexcept { m_start = std::chrono::high_resolution_clock::now(); }
__forceinline__ void stop() { m_stop = std::chrono::high_resolution_clock::now(); }
__forceinline__ void stop() noexcept { m_stop = std::chrono::high_resolution_clock::now(); }
// In seconds:
[[nodiscard]] __forceinline__ nvbench::float64_t get_duration()