Skip to content

Commit 78ccd69

Browse files
authored
use monotonic clock when timing functions in harvester (#19567)
1 parent baceeb8 commit 78ccd69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chia/harvester/harvester_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def new_signage_point_harvester(
8888
f"sp_hash: {new_challenge.sp_hash}, signage_point_index: {new_challenge.signage_point_index}"
8989
)
9090

91-
start = time.time()
91+
start = time.monotonic()
9292
assert len(new_challenge.challenge_hash) == 32
9393

9494
loop = asyncio.get_running_loop()
@@ -254,11 +254,11 @@ async def lookup_challenge(
254254
self.harvester.log.debug(f"new_signage_point_harvester {passed} plots passed the plot filter")
255255

256256
# Concurrently executes all lookups on disk, to take advantage of multiple disk parallelism
257-
time_taken = time.time() - start
257+
time_taken = time.monotonic() - start
258258
total_proofs_found = 0
259259
for filename_sublist_awaitable in asyncio.as_completed(awaitables):
260260
filename, sublist = await filename_sublist_awaitable
261-
time_taken = time.time() - start
261+
time_taken = time.monotonic() - start
262262
if time_taken > 8:
263263
self.harvester.log.warning(
264264
f"Looking up qualities on {filename} took: {time_taken}. This should be below 8 seconds"

0 commit comments

Comments
 (0)