`%%prun -r
returns profiling object
%%prun -D stats
from oneview.models.helpers.imports import pull_accounts_no_threaded
pull_accounts_no_threaded()
import pstats
from pstats import SortKey
= pstats.Stats('stats')
stats
# `tottime` for the total time spent in the given function (and excluding time
# made in calls to sub-functions)
'tottime').print_stats(50)
stats.sort_stats('cumtime').print_stats(50)
stats.sort_stats('filename').print_stats(50) stats.sort_stats(
Alternatively, Just timeit once
%%timeit -n 1 -r 1
from oneview.models.helpers.imports import pull_accounts, pull_accounts_no_threaded
pull_accounts()
See also - pstat sort keys - %prun documentation - %timeit documentation