From e1b9e8f2c969612e0effb42d5eba7848144cbbdb Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 22 Apr 2021 15:41:09 +0200 Subject: [PATCH] stop more times in repl tool --- examples/repl/cmdline.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs index 9d61f4d20..04e139591 100644 --- a/examples/repl/cmdline.rs +++ b/examples/repl/cmdline.rs @@ -603,8 +603,11 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu ensure!(sel_chat.is_some(), "Failed to select chat"); let sel_chat = sel_chat.as_ref().unwrap(); + let time_start = std::time::SystemTime::now(); let msglist = chat::get_chat_msgs(&context, sel_chat.get_id(), DC_GCM_ADDDAYMARKER, None).await?; + let time_needed = time_start.elapsed().unwrap_or_default(); + let msglist: Vec = msglist .into_iter() .map(|x| match x { @@ -659,7 +662,15 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu "{} messages.", sel_chat.get_id().get_msg_cnt(&context).await? ); + + let time_noticed_start = std::time::SystemTime::now(); chat::marknoticed_chat(&context, sel_chat.get_id()).await?; + let time_noticed_needed = time_noticed_start.elapsed().unwrap_or_default(); + + println!( + "{:?} to create this list, {:?} to mark all messages as noticed.", + time_needed, time_noticed_needed + ); } "createchat" => { ensure!(!arg1.is_empty(), "Argument missing.");