added a warn when frame lag
This commit is contained in:
@@ -261,6 +261,7 @@ impl<'a> ApplicationHandler for App<'a> {
|
|||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
if next < now {
|
if next < now {
|
||||||
next = now + Duration::from_secs_f64(1. / 30.);
|
next = now + Duration::from_secs_f64(1. / 30.);
|
||||||
|
println!("Warning: rendering is lagging!")
|
||||||
}
|
}
|
||||||
event_loop.set_control_flow(winit::event_loop::ControlFlow::WaitUntil(next));
|
event_loop.set_control_flow(winit::event_loop::ControlFlow::WaitUntil(next));
|
||||||
if let Some(w) = self.w.as_ref() {
|
if let Some(w) = self.w.as_ref() {
|
||||||
|
|||||||
Reference in New Issue
Block a user