MCPcopy Create free account
hub / github.com/RustCV/RustCV / get_fps

Method get_fps

rustcv/src/core/tick_meter.rs:54–61  ·  view source on GitHub ↗

获取当前的 FPS (Frames Per Second) 公式:次数 / 总耗时

(&self)

Source from the content-addressed store, hash-verified

52 /// 获取当前的 FPS (Frames Per Second)
53 /// 公式:次数 / 总耗时
54 pub fn get_fps(&self) -> f64 {
55 let secs = self.total_time.as_secs_f64();
56 if secs > 0.0 {
57 self.counter as f64 / secs
58 } else {
59 0.0
60 }
61 }
62
63 /// 获取当前累计的帧数
64 pub fn get_counter(&self) -> u64 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected