| Server IP : 121.121.20.254 / Your IP : 216.73.217.141 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python315/Lib/__pycache__/ |
Upload File : |
R
>lqj�: c � � Q s ] PHs] PHs] PHs] PHs, QNsQsQs]s\O s
Qs\s
QsQ s Q Q2 sQQ\
\P1Q ksQQ\
\\P1Q
ksQQP-Q kks\Q
6X c \O* \ 2 2 P! P! )a� Tool 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.
Classes:
Timer
Functions:
timeit(string, string) -> float
repeat(string, string) -> list
default_timer() -> float
�Timerz<timeit-src>i@B g�������?z�
def inner(_it, _timer{init}):
{setup}
_t0 = _timer()
for _i in _it:
{stmt}
pass
_t1 = _timer()
return _t1 - _t0
c �D � U O QQQU* * 2 ! )z*Helper to reindent a multi-line statement.�
� )�replace)�src�indents &&�C:\Python315\\Lib\timeit.py�reindentr 2 s � ��;�;�t�T�C�&�L�0�1�1� c �j ` � \ sQ s]7s n QsQQ\P1Q ksQ Q ks\1Q ks \
\1Q ksP\1Q ks
QsU sP! )
r a� 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.
�passc �n � V0m - oUe [ 2 LSoPo[ U[ 2 % c( [ U[
Q2 UQ* o[
U]2 oL.[ U2 % c V%Q$ UQ*
oPoQoL[ Q2 g[ U[ 2 % c% [ V�* [
Q2 [
U]2 oL,[ U2 % c VQ$ UQ*
oQ oL[ Q
2 g[ O VUQ5 o V�m [ U [
Q2 o
[ V�U2 UQ* U m
P! )
z#Constructor. See class doc string.�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 r r )�selfr r r �globals�local_ns� global_nsr �
stmtprefixr �codes &&&&& r �__init__�Timer.__init__I s � � �
���")�/�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�&��
r
c � � ] PHo] PHoU O dH [ U O 2 PU O O Q2 [
1UO [
$ UO QP
2 UQ$ UO QQU-U@ P! )an 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.
The optional colorize keyword argument controls whether the
traceback is colorized; it defaults to False for programmatic
usage. When used from the command line, this is automatically
set based on terminal capabilities.
r �colorize�file� ) � linecache� tracebackr �len�splitr �cache�get� print_exc)r r) �kwargsr+ r, s &&, r r1 �Timer.print_excl so � �, $��8�8��/2�4�8�8�}�/3�/3�x�x�~�~�d�/C�/=�/?�I�O�O�N�+� $�Z�Z�
�E�:��z�����0��0��0r
c �B � [ O PU2 o[ O 2 o[ O 2 U O V O 2 oU% c [ O 2 U! S% c [ O 2 h h 9 h)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.
)� itertools�repeat�gc� isenabled�disabler r �enable)r �number�it�gcold�timings && r �timeit�Timer.timeit� sg � � �
�
�d�F�
+�������
�
�
�� ��Z�Z��J�J�/�F��� � ���
�� �� � �� �s �A>