File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -736,13 +736,15 @@ def show_stats(byte_counts: Iterable[int]) -> None:
736736
737737 :param byte_counts: Iterable of byte counts per frame.
738738 """
739- start_time = time .clock_gettime (time .CLOCK_MONOTONIC )
739+ # If we needed high-precision, such as for benchmarking very short times, we might want to use time.perf_counter().
740+ # However, time.monotonic() is sufficient for simple stats reporting.
741+ start_time = time .monotonic ()
740742 time_deque : deque [float ] = deque (maxlen = 100 )
741743 byte_count_deque : deque [int ] = deque (maxlen = 100 )
742744 next_display_update = 0.0
743745 last_status_len = 0
744746 for frame_count , byte_count in enumerate (byte_counts ):
745- now = time .clock_gettime ( time . CLOCK_MONOTONIC )
747+ now = time .monotonic ( )
746748 time_deque .append (now )
747749 byte_count_deque .append (byte_count )
748750 if now >= next_display_update and len (time_deque ) > 1 :
You can’t perform that action at this time.
0 commit comments