From a91e67129e1f70993eaae75514825f40bdb6233d Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 16 Sep 2024 18:20:31 +0200 Subject: [PATCH] Update profiler output --- RNS/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/RNS/__init__.py b/RNS/__init__.py index 0af73ae..8828e48 100755 --- a/RNS/__init__.py +++ b/RNS/__init__.py @@ -363,7 +363,6 @@ def profiler(tag=None, capture=False, super_tag=None): trace_exception(e) def profiler_results(): - from rich.pretty import pprint from statistics import mean, median, stdev results = {} @@ -410,11 +409,13 @@ def profiler_results(): def print_tag_results(tag, level): ind = " "*level - print(f"{ind}{tag["name"]}") - print(f"{ind} Samples : {tag["count"]}") - print(f"{ind} Mean : {prettyshorttime(tag["mean"])}") - print(f"{ind} Median : {prettyshorttime(tag["median"])}") - print(f"{ind} St.dev. : {prettyshorttime(tag["stdev"])}") + name = tag["name"]; count = tag["count"] + mean = tag["mean"]; tag["median"]; stdev = tag["stdev"] + print(f"{ind}{name}") + print(f"{ind} Samples : {count}") + print(f"{ind} Mean : {prettyshorttime(mean)}") + print(f"{ind} Median : {prettyshorttime(median)}") + print(f"{ind} St.dev. : {prettyshorttime(stdev)}") print("") print("\nProfiler results:\n")