获取当前的 FPS (Frames Per Second) 公式:次数 / 总耗时
(&self)
| 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 { |
nothing calls this directly
no outgoing calls
no test coverage detected