How do I check how long it takes for my code to execute. Is there an inbuilt way in python. Or is there some hidden tool in my IDE PyCharm that let's me do so.
            Asked
            
        
        
            Active
            
        
            Viewed 1.5k times
        
    0
            
            
        - 
                    in additions to the answers of the original question, you can check the `timeit` module. – Jean-François Fabre Sep 24 '16 at 11:18
2 Answers
2
            You could try with
cProfile
in this way:
import cProfile
def myFunc():
   ...
cProfile.run('myFunc()')
Hope this solves your question!
 
    
    
        Shawn. L
        
- 403
- 1
- 3
- 13
0
            
            
        So profiler is already builtin tool in Pycharm, it uses cProfiler by default if you don't have yappi installed. Here is the link to it PyCharm profiler.
And if you want profile your code without any attachment to PyCharm, check that SO question How can you profile a Python script?
 
    
    
        Community
        
- 1
- 1
 
    
    
        vishes_shell
        
- 22,409
- 6
- 71
- 81
