From 28706e9c9307e50a34f1b7ac6687ae649d33a694 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 3 Oct 2020 13:12:42 +0200 Subject: [PATCH] Add timing --- etherpump/commands/pull.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/etherpump/commands/pull.py b/etherpump/commands/pull.py index 8c2980e..67e2678 100644 --- a/etherpump/commands/pull.py +++ b/etherpump/commands/pull.py @@ -3,6 +3,7 @@ import json import os import re import sys +import time from argparse import ArgumentParser from datetime import datetime from fnmatch import fnmatch @@ -455,15 +456,21 @@ async def handle_pads(args): padids = padids[args.skip : len(padids)] print("=" * 79) - print("Etherpump warming up the engines ...") + print("Etherpump is warming up the engines ...") print("=" * 79) + start = time.time() async with trio.open_nursery() as nursery: for padid in padids: nursery.start_soon(handle_pad, args, padid, data, info, session) + end = time.time() print("=" * 79) - print("Processed {} pads!".format(len(padids))) + print( + "Processed {} pads in {} seconds".format( + len(padids), round(end - start, 2) + ) + ) print("=" * 79)