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))