@@ -769,7 +769,7 @@ def pytest_collection(self) -> None:
769769 if self .isatty :
770770 if self .config .option .verbose >= 0 :
771771 self .write ("collecting ... " , flush = True , bold = True )
772- self ._collect_report_last_write = timing .time ()
772+ self ._collect_report_last_write = timing .perf_counter ()
773773 elif self .config .option .verbose >= 1 :
774774 self .write ("collecting ... " , flush = True , bold = True )
775775
@@ -789,7 +789,7 @@ def report_collect(self, final: bool = False) -> None:
789789
790790 if not final :
791791 # Only write "collecting" report every 0.5s.
792- t = timing .time ()
792+ t = timing .perf_counter ()
793793 if (
794794 self ._collect_report_last_write is not None
795795 and self ._collect_report_last_write > t - REPORT_COLLECTING_RESOLUTION
@@ -823,7 +823,7 @@ def report_collect(self, final: bool = False) -> None:
823823 @hookimpl (trylast = True )
824824 def pytest_sessionstart (self , session : Session ) -> None :
825825 self ._session = session
826- self ._sessionstarttime = timing .time ()
826+ self ._sessionstarttime = timing .perf_counter ()
827827 if not self .showheader :
828828 return
829829 self .write_sep ("=" , "test session starts" , bold = True )
@@ -1202,7 +1202,7 @@ def summary_stats(self) -> None:
12021202 if self .verbosity < - 1 :
12031203 return
12041204
1205- session_duration = timing .time () - self ._sessionstarttime
1205+ session_duration = timing .perf_counter () - self ._sessionstarttime
12061206 (parts , main_color ) = self .build_summary_stats_line ()
12071207 line_parts = []
12081208
0 commit comments