start method
dynamic
start()
Implementation
start() async {
if (_init ?? false) {
// 避免重复初始化
return;
}
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
//时间达到一秒了,开始计算这一秒的帧率
_calFps();
});
_registerListener();
// 获取当前手机的fps
if (_fpsHz == null) {
_fpsHz = await FpsPlugin.getRefreshRate;
}
_init = true;
}