From c2f64a65871d36eaacf36813bc66be9f4ee1997e Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Mon, 30 Jan 2023 13:54:59 -0500 Subject: [PATCH] avbroot.py: Add final status message to indicate the elapsed time Signed-off-by: Andrew Gunnerson --- avbroot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/avbroot.py b/avbroot.py index 01ebbfc..9d8a00e 100644 --- a/avbroot.py +++ b/avbroot.py @@ -6,6 +6,7 @@ import argparse import os import shutil import tempfile +import time import zipfile import avbtool @@ -234,6 +235,8 @@ def patch_subcommand(args): if not openssl.cert_matches_key(cert_ota, dec_privkey_ota): raise Exception('OTA certificate does not match private key') + start = time.perf_counter_ns() + with tempfile.NamedTemporaryFile() as temp_unsigned: metadata = patch_ota_zip( args.input, @@ -253,6 +256,10 @@ def patch_subcommand(args): metadata, ) + # Excluding the time it takes for the user to type in the passwords + elapsed = time.perf_counter_ns() - start + print_status(f'Completed after {elapsed / 1_000_000_000:.1f}s') + def extract_subcommand(args): # Set default temp directory to the output directory because this is the