perf counter

This commit is contained in:
Jack Robison 2020-03-01 12:34:36 -05:00
parent de50214e1f
commit dc6194f862
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -112,9 +112,9 @@ class MemPool:
"""Print regular logs of mempool stats.""" """Print regular logs of mempool stats."""
self.logger.info('beginning processing of daemon mempool. ' self.logger.info('beginning processing of daemon mempool. '
'This can take some time...') 'This can take some time...')
start = time.time() start = time.perf_counter()
await synchronized_event.wait() await synchronized_event.wait()
elapsed = time.time() - start elapsed = time.perf_counter() - start
self.logger.info(f'synced in {elapsed:.2f}s') self.logger.info(f'synced in {elapsed:.2f}s')
while True: while True:
self.logger.info(f'{len(self.txs):,d} txs ' self.logger.info(f'{len(self.txs):,d} txs '