]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/DpUtilities.c
ShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / DpUtilities.c
index 032e7b4ce1bdd5cc50cd5df9b7cbc06100a01dcb..fbdd938bc3bfbd1388515f909c7d4645000817a8 100644 (file)
@@ -2,7 +2,7 @@
   Utility functions used by the Dp application.\r
 \r
   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.\r
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -68,6 +68,10 @@ GetDuration (
   UINT64    Duration;\r
   BOOLEAN   Error;\r
 \r
+  if (Measurement->EndTimeStamp == 0) {\r
+    return 0;\r
+  }\r
+\r
   // PERF_START macros are called with a value of 1 to indicate\r
   // the beginning of time.  So, adjust the start ticker value\r
   // to the real beginning of time.\r