复刻 OpenCV C++ 的 cv::TickMeter 类 这是一个高精度的秒表,专门用于计算 FPS 和耗时
| 3 | /// 复刻 OpenCV C++ 的 cv::TickMeter 类 |
| 4 | /// 这是一个高精度的秒表,专门用于计算 FPS 和耗时 |
| 5 | pub struct TickMeter { |
| 6 | start_time: Option<Instant>, // 按下秒表的时刻 |
| 7 | total_time: Duration, // 累计走过的时间 |
| 8 | counter: u64, // 计次(比如统计了多少帧) |
| 9 | } |
| 10 | |
| 11 | impl Default for TickMeter { |
| 12 | fn default() -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected