Last active
June 30, 2023 06:31
-
-
Save jyhsu2000/20495f051d1a6b63101ef8415d45cdde to your computer and use it in GitHub Desktop.
Aggregate timing data of `codetiming.Timer`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from codetiming import Timer | |
timer_dfs = [] | |
for timer_name in Timer.timers: | |
timer_dfs.append(pd.DataFrame({ | |
'timer': timer_name, | |
'count': Timer.timers.count(timer_name), | |
'total': Timer.timers.total(timer_name), | |
'min': Timer.timers.min(timer_name), | |
'max': Timer.timers.max(timer_name), | |
'mean': Timer.timers.mean(timer_name), | |
'median': Timer.timers.median(timer_name), | |
'stdev': Timer.timers.stdev(timer_name), | |
}, index=[0])) | |
timer_df = pd.concat(timer_dfs, ignore_index=True) | |
print(timer_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment