From c215a6b9d5d7131b880ff84390504bfef4597cc8 Mon Sep 17 00:00:00 2001 From: dsc Date: Thu, 21 Jul 2022 18:12:29 +0200 Subject: [PATCH] Include generation time in final message --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8a8f145..a9bd98f 100644 --- a/main.py +++ b/main.py @@ -206,6 +206,7 @@ async def main(): # main loop while True: + now = datetime.now() random.shuffle(TASK_QUEUE._queue) task = await TASK_QUEUE.get() @@ -237,7 +238,8 @@ async def main(): _lower_author_task_count(task.author) - bot.send("PRIVMSG", target=task.channel, message=f"{url} \"{task.term}\" ({task.author}) ") + completed_secs = (datetime.now() - now).total_seconds() + bot.send("PRIVMSG", target=task.channel, message=f"{url} \"{task.term}\" ({completed_secs}sec, {task.author}) ") await asyncio.sleep(10) loop = asyncio.get_event_loop()