profile performance in iPython

`%%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

stats = pstats.Stats('stats')

# `tottime` for the total time spent in the given function (and excluding time
# made in calls to sub-functions)
stats.sort_stats('tottime').print_stats(50)
stats.sort_stats('cumtime').print_stats(50)
stats.sort_stats('filename').print_stats(50)

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