From 4610173208cc8f78a392ce56b8f972d11a839e8f Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Wed, 15 Dec 2021 15:50:26 +0100
Subject: [PATCH] Log sending/compute time for bot replies

---
 src/matrix.rs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/matrix.rs b/src/matrix.rs
index 10ea74d..3769de0 100644
--- a/src/matrix.rs
+++ b/src/matrix.rs
@@ -95,7 +95,6 @@ pub async fn connect_and_handle(config: Config) -> Result<()> {
             abort();
         }
     };
-
     GLOBAL_PKG.lock().unwrap().push(pkg);
 
     let on_msg_room_event = |ev: SyncMessageEvent<MessageEventContent>,
@@ -134,8 +133,8 @@ pub async fn connect_and_handle(config: Config) -> Result<()> {
                         joined.send(msg, None).await.unwrap();
                         let elapsed_after_send = now.elapsed();
                         warn!(
-                            "Elapsed before send {}ms, elapsed after send {}ms",
-                            elapsed_before_send.as_millis(),
+                            "Elapsed before send {}µs, elapsed after send {}ms",
+                            elapsed_before_send.as_micros(),
                             elapsed_after_send.as_millis()
                         );
                     }
-- 
GitLab