티스토리 뷰

[폰트사이즈18 고딕 진하게]



http://brownbears.tistory.com/248



from pstats import Stats
from cProfile import Profile
profile = Profile()
profile.runcall(count_prime, 100000)
stats = Stats(profile)
stats.strip_dirs()
stats.sort_stats('cumulative')
stats.print_stats()

ncalls: 프로파일링 주기 동안 함수 호출 횟수.


tottiem: 함수가 실행되는 동안 소비한 초 단위의 시간으로, 다른 함수 호출을 실행하는 데 걸린 시간은 배제.


tottime percall: 함수를 호출하는 데 걸린 평균 시간이며 초 단위. 다른 함수의 호출 시간은 배제. = tottime/ncalls


cumtime: 함수를 실행하는 데 걸린 초 단위 누적 시간이며, 다른 함수를 호출하는 데 걸린 시간도 포함.


cutime percall: 함수를 호출할 때마다 걸린 시간에 대한 초 단위 평균 시간이며, 다른 함수를 호출하는 데 걸린 시간도 포함. cutime / ncalls 

댓글