public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for commands
@ 2020-10-02 18:20 Bjorge, Erik C
  2020-10-02 19:46 ` Nate DeSimone
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorge, Erik C @ 2020-10-02 18:20 UTC (permalink / raw)
  To: devel
  Cc: Ashley E Desimone, Nate DeSimone, Puja Pandya, Bret Barkelew,
	Prince Agyeman

Added command timing in the entry point.

Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
---
 edkrepo/edkrepo_entry_point.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/edkrepo/edkrepo_entry_point.py b/edkrepo/edkrepo_entry_point.py
index dd2b36e..e944b7a 100644
--- a/edkrepo/edkrepo_entry_point.py
+++ b/edkrepo/edkrepo_entry_point.py
@@ -82,8 +82,11 @@ if __name__ == "__main__" or run_via_launcher_script:
                     sys.exit(1)
 
 from edkrepo.config.config_factory import GlobalConfig
+import datetime as dt
+
 
 def main():
+    start = dt.datetime.now()
     cfg_file = GlobalConfig()
     pref_entry = (cfg_file.preferred_entry[0]).replace('.py', '')
     pref_entry_func = cfg_file.preferred_entry[1]
@@ -91,12 +94,15 @@ def main():
     try:
         mod = importlib.import_module(pref_entry)
         func = getattr(mod, pref_entry_func)
-        return(func())
-    except Exception as e:
+        ret_code = func()
+    except Exception:
         print('Unable to launch preferred entry point. Launching default entry point edkrepo.edkrepo_cli.py')
         traceback.print_exc()
         import edkrepo.edkrepo_cli
-        return edkrepo.edkrepo_cli.main()
+        ret_code = edkrepo.edkrepo_cli.main()
+    print('\nExecution Time: {}'.format(dt.datetime.now() - start))
+    return ret_code
+
 
 if __name__ == "__main__":
     try:
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-05 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-02 18:20 [edk2-staging/EdkRepo] [PATCH v1] EdkRepo: Add timing for commands Bjorge, Erik C
2020-10-02 19:46 ` Nate DeSimone
     [not found]   ` <MW3PR11MB455429AF451846632C7218F2AE310@MW3PR11MB4554.namprd11.prod.outlook.com>
2020-10-05 20:22     ` Nate DeSimone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox