From: François Fleuret Date: Wed, 17 Jul 2024 20:31:56 +0000 (+0200) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=77b34ccf43a78741c434b5eadcef7b9240092886;p=culture.git Update. --- 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 = "???"