1
0
Files
BasaltMeter/BasaltPresenter/Presenter/stopwatch.hpp
2026-01-09 19:29:39 +08:00

22 lines
450 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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