--- nono/lib/stopwatch.h 2026/04/29 17:04:51 1.1.1.1 +++ nono/lib/stopwatch.h 2026/04/29 17:05:56 1.1.1.4 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// Stopwatch +// + #pragma once #include "header.h" @@ -34,8 +38,14 @@ class Stopwatch Start(); } + // ストップウォッチを停止して、経過時間をリセットする + void Reset() { + Stop(); + total = steady_clock::duration::zero(); + } + // 経過時間を nsec で返す - uint64 Elapsed() const { + uint64 Elapsed_nsec() const { using namespace std::chrono; if (running) { return duration_cast(Now() - epoch + total).count();