add timeinfo for 'listmsgs' repl command

This commit is contained in:
B. Petersen
2021-04-17 23:49:53 +02:00
committed by bjoern
parent 7be8fb7245
commit 2688f233b8

View File

@@ -525,9 +525,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
None, None,
) )
.await?; .await?;
let time_needed = std::time::SystemTime::now() let time_needed = time_start.elapsed().unwrap_or_default();
.duration_since(time_start)
.unwrap_or_default();
let cnt = chatlist.len(); let cnt = chatlist.len();
if cnt > 0 { if cnt > 0 {
@@ -898,10 +896,13 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
None None
}; };
let time_start = std::time::SystemTime::now();
let msglist = context.search_msgs(chat, arg1).await?; let msglist = context.search_msgs(chat, arg1).await?;
let time_needed = time_start.elapsed().unwrap_or_default();
log_msglist(&context, &msglist).await?; log_msglist(&context, &msglist).await?;
println!("{} messages.", msglist.len()); println!("{} messages.", msglist.len());
println!("{:?} to create this list", time_needed);
} }
"draft" => { "draft" => {
ensure!(sel_chat.is_some(), "No chat selected."); ensure!(sel_chat.is_some(), "No chat selected.");