ó
    Eñi$  ã                  ó,  • S r SSKJr  SSKrSSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	K	J
r
  \
(       a  SS
KJr  \R                  " SS9 " S S5      5       r\R                  " SS9 " S S5      5       r\R                   " S S5      5       r/ SQrg)zøIndirection for time functions.

We intentionally grab some "time" functions internally to avoid tests mocking "time" to affect
pytest runtime information (issue #185).

Fixture "mock_timing" also interacts with this module for pytest's own tests.
é    )ÚannotationsN)Údatetime)Útimezone©Úperf_counter)Úsleep©Útime)ÚTYPE_CHECKING)ÚMonkeyPatchT)Úfrozenc                  óŠ   • \ rS rSr% Sr\R                  " S SS9rS\S'   \R                  " S SS9r	S\S	'   SS
 jr
SS jrSrg)ÚInstanté   z›
Represents an instant in time, used to both get the timestamp value and to measure
the duration of a time span.

Inspired by Rust's `std::time::Instant`.
c                 ó   • [        5       $ ©Nr	   © ó    ÚK/home/mande/repo/quber/.venv/lib/python3.13/site-packages/_pytest/timing.pyÚ<lambda>ÚInstant.<lambda>#   s   € ¼D¼Fr   F)Údefault_factoryÚinitÚfloatr
   c                 ó   • [        5       $ r   r   r   r   r   r   r   (   s   € ¤¤r   Ú
perf_countc                ó&   • [        U [        5       S9$ )z1Measure the duration since `Instant` was created.)ÚstartÚstop)ÚDurationr   ©Úselfs    r   ÚelapsedÚInstant.elapsed+   s   € ä˜d¬«Ñ3Ð3r   c                ó`   • [         R                  " U R                  [        R                  5      $ )zInstant as UTC datetime.)r   Úfromtimestampr
   r   Úutcr!   s    r   Úas_utcÚInstant.as_utc/   s   € ä×%Ò% d§i¡i´·±Ó>Ð>r   r   N)Úreturnr    )r*   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚdataclassesÚfieldr
   Ú__annotations__r   r#   r(   Ú__static_attributes__r   r   r   r   r      sH   ‡ ñð ×#Ò#±NÈÑO€Dˆ%ÓOð $×)Ò)Ù.°Uñ€J�ó ô4÷?r   r   c                  óB   • \ rS rSr% SrS\S'   S\S'   \S	S j5       rSrg)
r    é4   z2A span of time as measured by `Instant.elapsed()`.r   r   r   c                ó\   • U R                   R                  U R                  R                  -
  $ )zaElapsed time of the duration in seconds, measured using a performance counter for precise timing.)r   r   r   r!   s    r   ÚsecondsÚDuration.seconds;   s#   € ð �y‰y×#Ñ# d§j¡j×&;Ñ&;Ñ;Ð;r   r   N©r*   r   )	r+   r,   r-   r.   r/   r2   Úpropertyr7   r3   r   r   r   r    r    4   s!   ‡ á<àƒNØ
ƒMàó<ó ó<r   r    c                  óx   • \ rS rSr% Sr\" SSSSSS5      R                  5       rS	\S
'   SS jr	SS jr
SS jrSrg)Ú
MockTimingéA   aê  Mocks _pytest.timing with a known object that can be used to control timing in tests
deterministically.

pytest itself should always use functions from `_pytest.timing` instead of `time` directly.

This then allows us more control over time during testing, if testing code also
uses `_pytest.timing` functions.

Time is static, and only advances through `sleep` calls, thus tests might sleep over large
numbers and obtain accurate time() calls at the end, making tests reliable and instant.iä  é   é   é   é   é2   r   Ú_current_timec                ó.   • U =R                   U-  sl         g r   ©rC   )r"   r7   s     r   r   ÚMockTiming.sleepP   s   € Ø×Ò˜gÑ%Ör   c                ó   • U R                   $ r   rE   r!   s    r   r
   ÚMockTiming.timeS   s   € Ø×!Ñ!Ð!r   c                ó¾   • SSK Jn  UR                  USU R                  5        UR                  USU R                  5        UR                  USU R                  5        g )Nr   )Útimingr   r
   r   )Ú_pytestrJ   Úsetattrr   r
   )r"   ÚmonkeypatchrJ   s      r   ÚpatchÚMockTiming.patchV   sG   € å"à×Ñ˜F G¨T¯Z©ZÔ8Ø×Ñ˜F F¨D¯I©IÔ6Ø×Ñ˜F N°D·I±IÕ>r   r   N)r7   r   r*   ÚNoner9   )rM   r   r*   rP   )r+   r,   r-   r.   r/   r   Ú	timestamprC   r2   r   r
   rN   r3   r   r   r   r<   r<   A   s;   ‡ ñ	_ñ $ D¨!¨R°°R¸Ó<×FÑFÓH€M�5ÓHô&ô"÷?r   r<   )r   r   r
   )r/   Ú
__future__r   r0   r   r   r
   r   r   Útypingr   Úpytestr   Ú	dataclassr   r    r<   Ú__all__r   r   r   Ú<module>rW      sš   ðñõ #ã Ý Ý Ý Ý Ý Ý  ö Ý"ð ×Ò˜dÑ#÷?ð ?ó $ð?ð6 ×Ò˜dÑ#÷	<ð 	<ó $ð	<ð ×Ñ÷?ð ?ó ð?ò: ,�r   