public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
@ 2020-05-09  2:22 Michael Kubacki
  2020-05-13  2:15 ` Bob Feng
  2020-05-14  7:18 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Kubacki @ 2020-05-09  2:22 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707

Ecc fails with Python 3.8 because it uses the deprecated time.clock()
function - https://docs.python.org/3.7/library/time.html#time.clock

This change updates EccMain.py to use time.perf_counter().

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
index 560bb9fd7a31..72edbea3b883 100644
--- a/BaseTools/Source/Python/Ecc/EccMain.py
+++ b/BaseTools/Source/Python/Ecc/EccMain.py
@@ -2,6 +2,7 @@
 # This file is used to be the main entrance of ECC tool
 #
 # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -406,9 +407,9 @@ if __name__ == '__main__':
     EdkLogger.Initialize()
     EdkLogger.IsRaiseError = False
 
-    StartTime = time.clock()
+    StartTime = time.perf_counter()
     Ecc = Ecc()
-    FinishTime = time.clock()
+    FinishTime = time.perf_counter()
 
     BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
     EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
-- 
2.16.3.windows.1


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

end of thread, other threads:[~2020-05-14  9:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-09  2:22 [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock() Michael Kubacki
2020-05-13  2:15 ` Bob Feng
2020-05-14  7:37   ` [edk2-devel] " Philippe Mathieu-Daudé
2020-05-14  8:18     ` Michael Kubacki
2020-05-14  8:45       ` Philippe Mathieu-Daudé
2020-05-14  9:12         ` Bob Feng
2020-05-14  7:18 ` Philippe Mathieu-Daudé

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