grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026ó ’Ó<œƒ3‚cãóî•SrSSKrSSKrSSKrSSKr/SQrSrSrSr\Rr \ r Sr Sr"S S 5rS S \ \S4S jrS S \ \\S4S jrSSS.Sjjr\S:Xa\R("\"55 gg)a9Tool for measuring execution time of small code snippets. This module avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the Algorithms chapter in the Python Cookbook, published by O'Reilly. Library usage: see the Timer class. Command line usage: python timeit.py [-n N] [-r N] [-s S] [-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 5) -s/--setup S: statement to be executed once initially (default 'pass'). Execution time of this setup statement is NOT timed. -p/--process: use time.process_time() (default is time.perf_counter()) -v/--verbose: print raw timing results; repeat for more digits precision -u/--unit: set the output time unit (nsec, usec, msec, or sec) -h/--help: print this usage message and exit --: separate options from statement, use when statement starts with - statement: statement to be timed (default 'pass') A multi-line statement may be given by specifying each line as a separate argument; indented lines are possible by enclosing an argument in quotes and using leading spaces. Multiple -s options are treated similarly. If -n is not given, a suitable number of loops is calculated by trying increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the total time is at least 0.2 seconds. Note: there is a certain baseline overhead associated with executing a pass statement. It differs between versions. The code here doesn't try to hide it, but you should be aware of it. The baseline overhead can be measured by invoking the program without arguments. Classes: Timer Functions: timeit(string, string) -> float repeat(string, string) -> list default_timer() -> float éN)ÚTimerÚtimeitÚrepeatÚ default_timerz i@Béz• def inner(_it, _timer{init}): {setup} _t0 = _timer() for _i in _it: {stmt} pass _t1 = _timer() return _t1 - _t0 có2•URSSSU--5$)z*Helper to reindent a multi-line statement.Ú Ú )Úreplace)ÚsrcÚindents Ú-/opt/alt/python313/lib64/python3.13/timeit.pyÚreindentrQs€à �;‰;�t˜T C¨&¡LÑ0Ó 1Ð1ócóX•\rSrSrSrSS\S4SjrS Sjr\4Sjr \ \4Sjr S S jr S r g) réVa˜Class for timing execution speed of small code snippets. The constructor takes a statement to be timed, an additional statement used for setup, and a timer function. Both statements default to 'pass'; the timer function is platform-dependent (see module doc string). If 'globals' is specified, the code will be executed within that namespace (as opposed to inside timeit's namespace). To measure the execution time of the first statement, use the timeit() method. The repeat() method is a convenience to call timeit() multiple times and return a list of results. The statements may contain newlines, as long as they don't contain multi-line string literals. ÚpassNcó2•X0l0nUc [5OUnSn[U[5(a#[ U[ S5 US-n[ US5nO)[U5(aX%S'US- nSnSnO [S 5e[U[5(a [ X�-[ S5 [ US 5nO'[U5(a XS 'US - nS nO [S5e[RXUS9n X�l [ U [ S5n [X¦U5 USUl g)z#Constructor. See class doc string.NÚÚexecr éÚ_setupz, _setup=_setupz_setup()z&setup is neither a string nor callableéÚ_stmtz , _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)ÚstmtÚsetupÚinitÚinner)ÚtimerÚ_globalsÚ isinstanceÚstrÚcompileÚdummy_src_namerÚcallableÚ ValueErrorÚtemplateÚformatr rr) ÚselfrrrÚglobalsÚlocal_nsÚ global_nsrÚ stmtprefixr Úcodes rÚ__init__ÚTimer.__init__hs€ðŒ ؈Ø")¡/”H”J°wˆ ØˆÜ �eœS× !Ñ !ä �Eœ>¨6Ô 2Ø ™ˆJܘU AÓ&‰EÜ �e�_‰_Ø!&�XÑ Ø Ð%Ñ %ˆD؈J؉EäÐEÓFÐ FÜ �dœC× Ñ ä �JÑ%¤~°vÔ >ܘD !Ó$‰DÜ �d�^‰^Ø $�WÑ Ø �OÑ #ˆD؉DäÐDÓEÐ EÜ�o‰o 4¸4ˆoÐ@ˆØŒÜ�sœN¨FÓ3ˆÜ ˆT˜hÔ'ؘgÑ&ˆ� rcóÚ•SSKnSSKnURbG[UR5SURR S5[ 4UR [ 'URUS9 g)a‘Helper to print a traceback from the timed code. Typical use: t = Timer(...) # outside the try/except try: t.timeit(...) # or t.repeat(...) except: t.print_exc() The advantage over the standard traceback is that source lines in the compiled template will be displayed. The optional file argument directs where the traceback is sent; it defaults to sys.stderr. rNr ©Úfile)Ú linecacheÚ tracebackr ÚlenÚsplitr$ÚcacheÚ print_exc)r)r3r4r5s rr9ÚTimer.print_exc‹sU€÷" $Ø �8‰8Ñ Ü/2°4·8±8«}Ø/3Ø/3¯x©x¯~©~¸dÓ/CÜ/=ð/?ˆI�O‰OœNÑ +ð ×Ñ ÐÒ&rcó<•[R"SU5n[R"5n[R"5 UR X R 5nU(a[R"5 U$!U(a[R"5 ff=f)a¦Time 'number' executions of the main statement. To be precise, this executes the setup statement once, and then returns the time it takes to execute the main statement a number of times, as float seconds if using the default timer. The argument is the number of times through the loop, defaulting to one million. The main statement, the setup statement and the timer function to be used are passed to the constructor. N)Ú itertoolsrÚgcÚ isenabledÚdisablerrÚenable)r)ÚnumberÚitÚgcoldÚtimings rrÚ Timer.timeit¦sg€ô× Ò ˜d FÓ +ˆÜ— ’ “ˆÜ � Š Œ ð Ø—Z‘Z §J¡JÓ/ˆFæÜ— ’ ” ؈ øöÜ— ’ • ðús ÁA<Á<Bcór•/n[U5H%nURU5nURU5 M' U$)ahCall timeit() a few times. This is a convenience function that calls the timeit() repeatedly, returning a list of results. The first argument specifies how many times to call timeit(), defaulting to 5; the second argument specifies the timer argument, defaulting to one million. Note: it's tempting to calculate mean and standard deviation from the result vector and report these. However, this is not very useful. In a typical case, the lowest value gives a lower bound for how fast your machine can run the given code snippet; higher values in the result vector are typically not caused by variability in Python's speed, but by other processes interfering with your timing accuracy. So the min() of the result is probably the only number you should be interested in. After that, you should look at the entire vector and apply common sense rather than statistics. )ÚrangerÚappend)r)rrAÚrÚiÚts rrÚ Timer.repeatºs7€ð( ˆÜ�v–ˆAØ— ‘ ˜FÓ#ˆAØ �H‰H�QŽKñðˆrcó†•SnSH2nX#-nURU5nU(aU"XE5 US:¼dM/XE4s $ US-nM?)aoReturn the number of loops and time taken so that total time >= 0.2. Calls the timeit method with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2 second. Returns (number, time_taken). If *callback* is given and is not None, it will be called after each trial with two arguments: ``callback(number, time_taken)``. é)rNérgš™™™™™É?é )r)r)ÚcallbackrJÚjrAÚ time_takens rÚ autorangeÚTimer.autorangeÔsW€ð ˆØÛ�Ø™�Ø!Ÿ[™[¨Ó0� ÞÙ˜VÔ0Ø Õ$Ø"Ð/Ò/ñ ð �‰GˆAñr)rr r©N)Ú__name__Ú __module__Ú __qualname__Ú__firstlineno__Ú__doc__rr/r9Údefault_numberrÚdefault_repeatrrTÚ__static_attributes__©rrrrVs9†ñð"#¨&¸ Øô!'ôF'ð6+ôð(+°>ô÷4rrrcó8•[XX$5RU5$)zCConvenience function to create Timer object and call timeit method.)rr)rrrrAr*s rrrês€ô �˜eÓ -× 4Ñ 4°VÓ <Ðg�íµ ÷ư>gü©ñÒMbP?gð?)ÚnsecÚusecÚmsecÚsecé)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r2)z-rz--repeat)z-pz --process)z-vz --verbose)z-hz--helpr )Úendc óZ>•SnUS:gn[URX(aSOSUTS95 g)Nz${num} loop{s} -> {secs:.{prec}g} secrNÚsr)ÚnumrnÚsecsÚprec)Úprintr()rArSÚmsgÚpluralÚ precisions €rrQÚmain..callbackDs8ø€Ø<�Ø  A™+�Ü�c—j‘j Vµf©sÀ"Ø&0°yð!ðBõCrcóÈ>•TnUbTUnOFTR5VVs/sHupX!4PM nnnURSS9 UH up!X:¼dM O STUW- W4-$s snnf)NT)Úreversez%.*g %s)ÚitemsÚsort)ÚdtÚunitÚscaleÚscalesruÚ time_unitÚunitss €€€rÚ format_timeÚmain..format_timeXsuø€Øˆà Ñ Ø˜$‘K‰Eà7<·{±{´}ÔE²}© ¨�u“m±}ˆFÑEØ �K‰K ˆKÑ %Û%‘ �Ø•;Ùñ &ð˜I r¨E¡z°4Ð8Ñ8Ð8ùó Fs Az raw times: %sz, z"%d loop%s, best of %d: %s per looprnrrz8The test results are likely unreliable. The worst time (z6) was more than four times slower than the best time (z).)ÚsysÚargvÚgetoptÚerrorrrrÚjoinr]ÚintrHÚstderrÚtimeÚ process_timer[ÚosÚpathÚinsertÚcurdirrrTr9rÚmapÚminÚmaxÚwarningsÚ warn_explicitÚ UserWarning)Úargsrbr…ÚoptsÚerrrrrArrreÚoÚarŒrKrQÚ_Ú raw_timingsr�r{ÚtimingsÚbestÚworstr“rurr€s @@@rÚmainr ösøú€ð" �|Ü�x‰x˜˜ˆ|ˆÛðØ—]‘] 4¨ò$KóL‰ ˆô €EØ �9‰9�T‹?× $˜f€DØ €FØ €EÜ €FØ€GØ€IØ 4°¸cÑ B€EØ€IÛ‰ˆØ Ð"Ó "ܘ“VˆFØ Ð!Ó !Ø �L‰L˜ŒOØ Ð Ó Ø�E‹zØ‘ äÐRÜŸ:™:ò'áØ Ð"Ó "ܘ“VˆFؘ‹{Ø�Ø Ð#Ó #Ü×%Ñ%ˆEØ Ð#Ó #ÞØ˜Q‘� Ø �q‰LˆGØ Ð Õ Ü ”'˜sÒ #Ùñ1ð2 �I‰I�eÓ × & €Eó ܇H�H‡O�O�A�r—y‘yÔ!ØÑÙ˜EÓ"ˆä ˆd˜5Ó!€AØ �ƒ{àˆÞ õ Cð  ØŸ ™  HÓ-‰IˆF�Aö Ü ŒGðØ—h‘h˜vÓ.ˆ ÷ 9öÜ ˆo § ¡ ¬#¨k¸;Ó*GÓ HÑHÔIÜ ŒÙ%0Ó1¢[˜rˆr�FŒ{¡[€GÐ1ä ˆw‹<€DÜ Ð .Ø  a›K‘S¨RØ ‘[ Ó&ð (ñ (ô)ô ˆw‹<€DÜ �‹L€EØ ��q‘ÓÛØ×Òñ#.¨eÖ"4±kÀ$Ö6Gð Iô +¨B°ô  3ð øðW �<‰<óÜ ˆcŒ Ü Ð3Ô4Üûðûðz Ø �K‰KŒMÙûðØ � ‰ Œ Ùüò&2s5ŸJ!ÆKÇK+ÈLÊ!KÊ1K Ë KËK(Ë+K?Ú__main__rV)r[r=r<rƒrŠÚ__all__r$r\r]Ú perf_counterrr*r r'rrrrr rWÚexitr_rrÚr¥s«ðñ/ób ÛÛ Û â 8€à€Ø€Ø€Ø×!Ñ!€ à €ð €ò2÷ QñQðh˜f¨MØ ¨$ô=ð ˜f¨MØ ¨ÀôEð C 4öCðL ˆzÓØ‡H‚H‰T‹VÕðr