black/cache

This commit is contained in:
Sander Land committed 2020-12-07 22:51:57 +01:00
1 parent d2c8ea91ad
commit a51e9c3acc
3 files changed
+10 -11

No files matched your search

+5 -3
View File
@@ -584,14 +584,16 @@ class KaTrainGui(Screen, KaTrainBase):
self(*shortcut)
elif keycode[1] == "f9" and self.debug_level >= OUTPUT_EXTRA_DEBUG:
import yappi
yappi.set_clock_type("cpu")
yappi.start()
self.log("starting profiler",OUTPUT_ERROR)
self.log("starting profiler", OUTPUT_ERROR)
elif keycode[1] == "f10" and self.debug_level >= OUTPUT_EXTRA_DEBUG:
import yappi, time
stats = yappi.get_func_stats()
filename =f"callgrind.{int(time.time())}.prof"
stats.save(filename, type='callgrind')
filename = f"callgrind.{int(time.time())}.prof"
stats.save(filename, type="callgrind")
self.log(f"wrote profiling results to {filename}", OUTPUT_ERROR)
return True