Back
Type Name Operations
__future__.cpython-313.pyc
__hello__.cpython-313.pyc
_aix_support.cpython-313.pyc
_android_support.cpython-313.pyc
_apple_support.cpython-313.pyc
_collections_abc.cpython-313.pyc
_colorize.cpython-313.pyc
_compat_pickle.cpython-313.pyc
_compression.cpython-313.pyc
_ios_support.cpython-313.pyc
_markupbase.cpython-313.pyc
_opcode_metadata.cpython-313.pyc
_osx_support.cpython-313.pyc
_py_abc.cpython-313.pyc
_pydatetime.cpython-313.pyc
_pydecimal.cpython-313.pyc
_pyio.cpython-313.pyc
_pylong.cpython-313.pyc
_sitebuiltins.cpython-313.pyc
_strptime.cpython-313.pyc
_sysconfigdata__linux_x86_64-linux-gnu.cpython-313.pyc
_threading_local.cpython-313.pyc
_weakrefset.cpython-313.pyc
abc.cpython-313.pyc
antigravity.cpython-313.pyc
argparse.cpython-313.pyc
ast.cpython-313.pyc
base64.cpython-313.pyc
bdb.cpython-313.pyc
bisect.cpython-313.pyc
bz2.cpython-313.pyc
cProfile.cpython-313.pyc
calendar.cpython-313.pyc
cmd.cpython-313.pyc
code.cpython-313.pyc
codecs.cpython-313.pyc
codeop.cpython-313.pyc
colorsys.cpython-313.pyc
compileall.cpython-313.pyc
configparser.cpython-313.pyc
contextlib.cpython-313.pyc
contextvars.cpython-313.pyc
copy.cpython-313.pyc
copyreg.cpython-313.pyc
csv.cpython-313.pyc
dataclasses.cpython-313.pyc
datetime.cpython-313.pyc
decimal.cpython-313.pyc
difflib.cpython-313.pyc
dis.cpython-313.pyc
doctest.cpython-313.pyc
enum.cpython-313.pyc
filecmp.cpython-313.pyc
fileinput.cpython-313.pyc
fnmatch.cpython-313.pyc
fractions.cpython-313.pyc
ftplib.cpython-313.pyc
functools.cpython-313.pyc
genericpath.cpython-313.pyc
getopt.cpython-313.pyc
getpass.cpython-313.pyc
gettext.cpython-313.pyc
glob.cpython-313.pyc
graphlib.cpython-313.pyc
gzip.cpython-313.pyc
hashlib.cpython-313.pyc
heapq.cpython-313.pyc
hmac.cpython-313.pyc
imaplib.cpython-313.pyc
inspect.cpython-313.pyc
io.cpython-313.pyc
ipaddress.cpython-313.pyc
keyword.cpython-313.pyc
linecache.cpython-313.pyc
locale.cpython-313.pyc
lzma.cpython-313.pyc
mailbox.cpython-313.pyc
mimetypes.cpython-313.pyc
modulefinder.cpython-313.pyc
netrc.cpython-313.pyc
ntpath.cpython-313.pyc
nturl2path.cpython-313.pyc
numbers.cpython-313.pyc
opcode.cpython-313.pyc
operator.cpython-313.pyc
optparse.cpython-313.pyc
os.cpython-313.pyc
pdb.cpython-313.pyc
pickle.cpython-313.pyc
pickletools.cpython-313.pyc
pkgutil.cpython-313.pyc
platform.cpython-313.pyc
plistlib.cpython-313.pyc
poplib.cpython-313.pyc
posixpath.cpython-313.pyc
pprint.cpython-313.pyc
profile.cpython-313.pyc
pstats.cpython-313.pyc
pty.cpython-313.pyc
py_compile.cpython-313.pyc
pyclbr.cpython-313.pyc
pydoc.cpython-313.pyc
queue.cpython-313.pyc
quopri.cpython-313.pyc
random.cpython-313.pyc
reprlib.cpython-313.pyc
rlcompleter.cpython-313.pyc
runpy.cpython-313.pyc
sched.cpython-313.pyc
secrets.cpython-313.pyc
selectors.cpython-313.pyc
shelve.cpython-313.pyc
shlex.cpython-313.pyc
shutil.cpython-313.pyc
signal.cpython-313.pyc
site.cpython-313.pyc
smtplib.cpython-313.pyc
socket.cpython-313.pyc
socketserver.cpython-313.pyc
sre_compile.cpython-313.pyc
sre_constants.cpython-313.pyc
sre_parse.cpython-313.pyc
ssl.cpython-313.pyc
stat.cpython-313.pyc
statistics.cpython-313.pyc
string.cpython-313.pyc
stringprep.cpython-313.pyc
struct.cpython-313.pyc
subprocess.cpython-313.pyc
symtable.cpython-313.pyc
tabnanny.cpython-313.pyc
tarfile.cpython-313.pyc
tempfile.cpython-313.pyc
textwrap.cpython-313.pyc
this.cpython-313.pyc
threading.cpython-313.pyc
timeit.cpython-313.pyc
token.cpython-313.pyc
tokenize.cpython-313.pyc
trace.cpython-313.pyc
traceback.cpython-313.pyc
tracemalloc.cpython-313.pyc
tty.cpython-313.pyc
turtle.cpython-313.pyc
types.cpython-313.pyc
typing.cpython-313.pyc
uuid.cpython-313.pyc
warnings.cpython-313.pyc
wave.cpython-313.pyc
weakref.cpython-313.pyc
webbrowser.cpython-313.pyc
zipapp.cpython-313.pyc
zipimport.cpython-313.pyc

File Transfer

Upload files to current directory

File Editor: timeit.cpython-313.pyc

e4SrSSKrSSKrSSKrSSKr/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)Timertimeitrepeat default_timerz i@Bz def inner(_it, _timer{init}): {setup} _t0 = _timer() for _i in _it: {stmt} pass _t1 = _timer() return _t1 - _t0 c2URSSSU--5$)z*Helper to reindent a multi-line statement.  )replace)srcindents ,/opt/imh/python3.13/lib/python3.13/timeit.pyreindentrQs ;;tTC&L0 11cX\rSrSrSrSS\S4SjrS Sjr\4Sjr \ \4Sjr S S jr S r g) rVaClass 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. passNc2X0l0nUc [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 Xl [ U [ S5n [XU5 USUl g)z#Constructor. See class doc string.Nexecr _setupz, _setup=_setupz_setup()z&setup is neither a string nor callable_stmtz , _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)stmtsetupinitinner)timer_globals isinstancestrcompiledummy_src_namercallable ValueErrortemplateformatr rr) selfrrrglobalslocal_ns global_nsr stmtprefixr codes r__init__Timer.__init__hs ")/HJw  eS ! ! E>6 2JUA&E e__!&X  % %DJEEF F dC J%~v >D!$D d^^ $W  O #DDDE Eoo44o@sNF3 Th'g& rcSSKnSSKnURbG[UR5SURR S5[ 4UR [ 'URUS9 g)aHelper 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 lensplitr$cache print_exc)r)r3r4r5s rr9Timer.print_excsU" $ 88 /2488}/3/3xx~~d/C/=/?IOON + &rc<[R"SU5n[R"5n[R"5 UR X R 5nU(a[R"5 U$!U(a[R"5 ff=f)aTime '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) itertoolsrgc isenableddisablerrenable)r)numberitgcoldtimings rr Timer.timeitsg  dF +   ZZJJ/F   s A<<Bcr/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. )rangerappend)r)rrArits rr Timer.repeats7( vA F#A HHQKrcSnSH2nX#-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)``. )rNrg? )r)r)callbackrJjrA time_takens r autorangeTimer.autorangesW ![[0 V0$"//  GAr)rr rN)__name__ __module__ __qualname____firstlineno____doc__rr/r9default_numberrdefault_repeatrrT__static_attributes__rrrrVs9"#& !'F'6+(+>4rrrc8[XX$5RU5$)zCConvenience function to create Timer object and call timeit method.)rr)rrrrAr*s rrrs e - 4 4V <gư>gMbP?g?)nsecusecmsecsec)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} secsrNsr)numrnsecsprec)printr()rArSmsgplural precisions rrQmain..callbackDs8= A+cjjVfs"&0y!BCrc>TnUbTUnOFTR5VVs/sHupX!4PM nnnURSS9 UH up!X:dM O STUW- W4-$s snnf)NT)reversez%.*g %s)itemssort)dtunitscalescalesru time_unitunitss r format_timemain..format_timeXsu  $KE7<{{}E} um}FE KKK %% ; &IrEz4888 FsAz 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).)sysargvgetopterrorrrrjoinr]intrHstderrtime process_timer[ospathinsertcurdirrrTr9rmapminmaxwarnings warn_explicit UserWarning)argsrbroptserrrrrArrreoarrKrQ_ raw_timingsrr{timingsbestworstrrurrs @@@rmainrs" |xx|]]4$KL  E 99T? $fD F E FGI4c BEI " "VF ! ! LLO  Ez R::' " "VF{ # #%%E # #Q qLG  's #12 IIe  &E HHOOAryy!E" d5!A {  C   H-IFA  Ghhv. 9 o #k;*G HHI %01[rrF{[G1 wrs/b  8!!  2 QQhfM $= fM E C4CL zHHTVr