From 1ec2599c45a51dde87496edce7cd3ab301a18539 Mon Sep 17 00:00:00 2001 From: Micha White Date: Mon, 8 May 2023 18:23:55 -0400 Subject: Bunnymark update --- render/examples/bunnymark.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'render/examples') diff --git a/render/examples/bunnymark.rs b/render/examples/bunnymark.rs index 1579cf0..1e171c1 100644 --- a/render/examples/bunnymark.rs +++ b/render/examples/bunnymark.rs @@ -24,6 +24,7 @@ struct State { texture_id: TextureId, bunnies: Vec, previous_timestamp: Option, + bad_frames: u8, seed: [u64; 2], stopped: bool, } @@ -35,6 +36,7 @@ impl State { bunnies: Vec::with_capacity(10_000_000), previous_timestamp: None, seed: [0x0D15EA5E8BADF00D, 0xDECAFBADDEADBEAF], + bad_frames: 0, stopped: false, } } @@ -56,7 +58,12 @@ impl State { )); if fps < 15.0 { - self.stopped = true; + self.bad_frames += 1; + if self.bad_frames == 3 { + self.stopped = true; + } + } else { + self.bad_frames = 0; } self.previous_timestamp = Some(Instant::now()); -- cgit v1.2.3