1
0

add stopwatch

This commit is contained in:
2026-01-09 19:29:39 +08:00
parent ff34754274
commit fba5d0627c
4 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#pragma once
#include <chrono>
namespace basalt::presenter::stopwatch {
/**
* @brief 一个简单的FPS计算器每隔指定次数统计一次FPS并输出
*/
class Stopwatch {
public:
Stopwatch(size_t interval);
~Stopwatch();
void tick();
private:
std::chrono::steady_clock::time_point start_point;
size_t interval, counter;
};
} // namespace basalt::presenter::stopwatch