From 44fe6e3ed21c81124db8f03032ec7702de69faae Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 9 Mar 2023 00:31:51 -0500 Subject: [PATCH] [O] Print draw time at 1,1 --- tngame-rs/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tngame-rs/src/main.rs b/tngame-rs/src/main.rs index 35f9c4c..60a152b 100644 --- a/tngame-rs/src/main.rs +++ b/tngame-rs/src/main.rs @@ -400,7 +400,9 @@ async fn start_update_loop(mt: Arc>, cn: &Consts) -> Result<()> { let end = Instant::now(); let draw_time = (end - now).as_secs_f32(); - txt.push_str(&*format!("\rDraw time: {:.2}ms", draw_time * 1000.0)); + // Print draw time at 1, 1 + txt.push_str(&Goto(1, 1).to_string()); + txt.push_str(&*format!("\r{:.2}ms", draw_time * 1000.0)); // Frame end with 3 Null bytes txt.push_str("\x00\x00\x00");