diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2020-05-09 10:22:42 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-05-13 05:52:03 +0000 |
commit | 242ab73d7f255d5d859eaf74a23b9d68c686d177 (patch) | |
tree | ea0881ff77eb5ba86a2e6aca56fe6fd59bf7c79c /BaseTools | |
parent | 88899a372cfc44f8612315f4b43a084d1814fe69 (diff) | |
download | edk2-242ab73d7f255d5d859eaf74a23b9d68c686d177.tar.gz edk2-242ab73d7f255d5d859eaf74a23b9d68c686d177.tar.bz2 edk2-242ab73d7f255d5d859eaf74a23b9d68c686d177.zip |
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 <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/Ecc/EccMain.py | 5 |
1 files 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.<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))
|