Fix get time spent again

This commit is contained in:
Nexus 2023-11-11 18:52:41 +00:00
parent fde8760252
commit e936f9a4e3
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -1960,7 +1960,7 @@ class OtherCog(commands.Cog):
def get_time_spent(nanoseconds: int) -> str: def get_time_spent(nanoseconds: int) -> str:
hours, minutes, seconds = 0, 0, 0 hours, minutes, seconds = 0, 0, 0
seconds = nanoseconds * 1e9 seconds = nanoseconds / 1e9
if seconds >= 60: if seconds >= 60:
minutes, seconds = divmod(seconds, 60) minutes, seconds = divmod(seconds, 60)
if minutes >= 60: if minutes >= 60:
@ -1989,7 +1989,7 @@ class OtherCog(commands.Cog):
total_time_spent = get_time_spent(chunk["total_duration"]) total_time_spent = get_time_spent(chunk["total_duration"])
eval_time_spent = get_time_spent(chunk["eval_duration"]) eval_time_spent = get_time_spent(chunk["eval_duration"])
tokens_per_second = chunk["eval_count"] / (chunk["eval_duration"] * 1e9) tokens_per_second = chunk["eval_count"] / chunk["eval_duration"]
output.add_field( output.add_field(
name="Timings", name="Timings",
value="Total: {}\nEval: {} ({:,.2f}/s)".format( value="Total: {}\nEval: {} ({:,.2f}/s)".format(