From 77b34ccf43a78741c434b5eadcef7b9240092886 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Wed, 17 Jul 2024 22:31:56 +0200 Subject: [PATCH] Update. --- main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 178925b..bdfe9fd 100755 --- a/main.py +++ b/main.py @@ -467,11 +467,14 @@ def record_new_c_quizzes(models, quiz_machine, nb_for_train=1000, nb_for_test=10 duration = time.perf_counter() - start_time - if total_nb_validated > 0 and total_nb_validated < nb_to_create: - d = (nb_to_create - total_nb_validated) * duration / total_nb_validated - e = (datetime.datetime.now() + datetime.timedelta(seconds=d)).strftime( - "%a %H:%M" - ) + if total_nb_validated > 0: + if total_nb_validated < nb_to_create: + d = (nb_to_create - total_nb_validated) * duration / total_nb_validated + e = (datetime.datetime.now() + datetime.timedelta(seconds=d)).strftime( + "%a %H:%M" + ) + else: + e = "now!" else: e = "???" -- 2.39.5