Python comes with a battery
Battery: Python standard library
The Python standard library contains the modules required for general tasks
Python Documentation
timeit.__doc__
timeid__all__
timeit.__file__
Dir (Timeit)
Help (Timeit)
>>>ImportTimeit>>>Print(Timeit.__doc__) Tool formeasuring execution time of small code snippets. This module avoids a number of common traps formeasuring executiontimes. See also Tim Peters'Introduction to the algorithms chapter inThe Python Cookbook, published by O'Reilly.Library Usage:see the Timerclass. Command line Usage:python timeit.py [N-N] [-R N] [-S] [-t] [-c] [-p] [-h] [--] [statement]options:-n/--number N:how many times to execute'Statement'(Default:see below)-r/--repeat N:how many times to repeat the timer (default 3) -s/--setup s:statement to be executed once initially (default'Pass'). Execution time of this setup statement isNot timed. -p/--process:use time.process_time () (Default istime.perf_counter ())-t/--time:use time.time () (deprecated)-c/--clock:use time.clock () (deprecated)-v/--verbose:PrintRaw timing results; Repeat forMore digits Precision-u/--unit:set The output Time unit (USEC, msec,orsec)-h/--help:PrintThis usage message andExit--: Separate options fromStatement, use if statement starts with-statement:statement to be timed (default'Pass') A Multi-Line statement is given by specifying each line as aseparate argument; indented lines is possible by enclosing an ArgumentinchQuotes andUsing leading spaces. Multiple-s Options aretreated similarly. If-N is notGiven, a suitable number of loops iscalculated by tryingsuccessive powers ofTen until the total time isAt least 0.2seconds. Note:there isa certain baseline overhead associated with executing aPassStatement. It differs between versions. The code here doesn'T Tryto hide it, and you should is aware of it. The baseline overhead can bemeasured by invoking the program without arguments. Classes:TimerFunctions:timeit (String, String)-float Repeat (string, string)-list Default_timer ()-float>>>dir (timeit) ['Timer','__all__','__builtins__','__cached__','__doc__','__file__','__loader__','__name__','__package__','__spec__','_globals','Default_number','default_repeat','Default_timer','Dummy_src_name','GC','Itertools','Main','reindent','Repeat','SYS','Template',' Time','Timeit']>>> Timeit.__all__['Timer','Timeit','Repeat','Default_timer']>>> fromTimeitImport*>>>Timer<class 'Timeit. Timer'>>>>ImportTimeit>>> Timeit.__file__'/usr/lib64/python3.6/timeit.py'>>> Help (Timeit)
Python--33 like a geek to think