@@ -38,8 +38,8 @@ def __init__(self, iterations, start_iteration=0, buffer_size=100):
38
38
39
39
def start (self ):
40
40
self .start_time = perf_counter ()
41
+ self .recent_times .append (self .start_time )
41
42
self .recent_iterations .append (self .start_iteration )
42
- self .recent_times .append (perf_counter ())
43
43
44
44
def end (self ):
45
45
avg_ips = float (self .iterations - self .start_iteration ) / (perf_counter () - self .start_time )
@@ -73,7 +73,7 @@ def convert_to_time_str(self, total_sec):
73
73
def update (self , iteration_count , return_values = False ):
74
74
self .update_buffer (iteration_count )
75
75
elapsed_sec = self .recent_times [- 1 ] - self .recent_times [0 ]
76
- total_iterations = iteration_count - self .recent_iterations [0 ]
76
+ total_iterations = self . recent_iterations [ - 1 ] - self .recent_iterations [0 ]
77
77
ips = total_iterations / elapsed_sec
78
78
eta = (self .iterations - iteration_count ) / ips
79
79
elapsed_time = perf_counter () - self .start_time
@@ -103,5 +103,5 @@ def update(self, iteration_count, return_values=False):
103
103
break
104
104
avg_ips , elapsed_time = eta_calculator .end ()
105
105
eta_calculator .reset ()
106
- print (f'\n total { total_iterations } iterations end successfully with avg IPS { avg_ips :.1f } , elapsed time : { elapsed_time } ' )
106
+ print (f'\n total { total_iterations } iterations end successfully with avg IPS { avg_ips :.2f } , elapsed time : { elapsed_time } ' )
107
107
0 commit comments