Skip to content

Commit 5adf29d

Browse files
committed
[update] logging in the demo to only show the last frame time when its above 20 milliseconds.
1 parent 0d4d4a5 commit 5adf29d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tools/lambda_rs_demo/src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ impl Component<Events> for DemoComponent {
9292
}
9393

9494
fn on_update(self: &mut DemoComponent, last_frame: &std::time::Duration) {
95-
println!(
96-
"This component was last updated: {} nanoseconds/{} milliseconds ago",
97-
last_frame.as_nanos(),
98-
last_frame.as_millis()
99-
);
95+
match last_frame.as_millis() > 20 {
96+
true => {
97+
println!("[WARN] Last frame took {}ms", last_frame.as_millis());
98+
}
99+
false => {}
100+
}
100101
}
101102
}
102103

0 commit comments

Comments
 (0)