+
    -j$                    <   R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ]
'       d   ^ R	IHt ]P                  ! R
R7       ! R R4      4       t]P                  ! R
R7       ! R R4      4       t]P                   ! R R4      4       t. ROtR# )zIndirection 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                      ] tR t^t$ Rt]P                  ! R RR7      tR]R&   ]P                  ! R RR7      t	R]R&   R	 R
 lt
R R ltRtR# )Instantz
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                 	    \        4       # Nr        c/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/_pytest/timing.py<lambda>Instant.<lambda>#   s    DFr   F)default_factoryinitfloatr	   c                 	    \        4       # r   r   r   r   r   r   r   (   s    r   
perf_countc                   V ^8  d   QhRR/# )   returnDurationr   )formats   "r   __annotate__Instant.__annotate__+   s     4 4 4r   c                ,    \        V \        4       R7      # )z1Measure the duration since `Instant` was created.)startstop)r   r   selfs   &r   elapsedInstant.elapsed+   s    d33r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r    r!   /   s     ? ? ?r   c                `    \         P                  ! V P                  \        P                  4      # )zInstant as UTC datetime.)r   fromtimestampr	   r   utcr%   s   &r   as_utcInstant.as_utc/   s    %%dii>>r   r   N)__name__
__module____qualname____firstlineno____doc__dataclassesfieldr	   __annotations__r   r'   r-   __static_attributes__r   r   r   r   r      sM     ##NOD%O $)).UJ 4? ?r   r   c                  F    ] tR t^4t$ RtR]R&   R]R&   ]R R l4       tRtR# )	r   z2A span of time as measured by `Instant.elapsed()`.r   r#   r$   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r    Duration.__annotate__<   s     < < <r   c                d    V P                   P                  V P                  P                  ,
          # )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#     yy##djj&;&;;;r   r   N)	r/   r0   r1   r2   r3   r6   propertyr=   r7   r   r   r   r   r   4   s!    <N
M< <r   r   c                      ] tR t^At$ Rt]! R^^^^^24      P                  4       tR]R&   R R lt	R R lt
R	 R
 ltRtR# )
MockTiminga  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  r   _current_timec                    V ^8  d   QhRRRR/# )r   r=   r   r   Noner   )r   s   "r   r    MockTiming.__annotate__P   s     & &U &t &r   c                	8    V ;P                   V,          un         R # r   rB   )r&   r=   s   &&r   r   MockTiming.sleepP   s    g%r   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r    rE   S   s     " "e "r   c                	    V P                   # r   rG   r%   s   &r   r	   MockTiming.timeS   s    !!!r   c                    V ^8  d   QhRRRR/# )r   monkeypatchr   r   rD   r   )r   s   "r   r    rE   V   s     ? ? ? ?r   c                	    ^ RI Hp VP                  VRV P                  4       VP                  VRV P                  4       VP                  VRV P                  4       R# )    )timingr   r	   r   N)_pytestrP   setattrr   r	   )r&   rM   rP   s   && r   patchMockTiming.patchV   sG    "FGTZZ8FFDII6FNDII>r   r   N)r/   r0   r1   r2   r3   r   	timestamprB   r6   r   r	   rS   r7   r   r   r   rA   rA   A   s@    	_ $D!RR<FFHM5H&"? ?r   rA   )r   r   r	   )r3   
__future__r   r4   r   r   r	   r   r   typingr
   pytestr   	dataclassr   r   rA   __all__r   r   r   <module>r[      s    #         " d#? ? $?6 d#	< 	< $	< ? ? ?: ,r   