From 242ab73d7f255d5d859eaf74a23b9d68c686d177 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Sat, 9 May 2020 10:22:42 +0800 Subject: [PATCH] BaseTools/Ecc: Replace deprecated function time.clock() 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 Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Bob Feng --- 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 560bb9fd7a..72edbea3b8 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.
+# Copyright (c) Microsoft Corporation.
# 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))