summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-28 11:41:34 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-28 11:41:34 +0000
commit5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2 (patch)
tree1a5f88e1885451d633737f44ad3082ea09891e01 /ArmPkg
parent8ca6180f216a0ff558919643a512563f4478fe8d (diff)
downloadedk2-platforms-5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2.tar.xz
ArmPkg/BdsLib: Check if the performance timer is counting down or up in PrintPerformance()
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11914 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/BdsLib/BdsHelper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsHelper.c b/ArmPkg/Library/BdsLib/BdsHelper.c
index fa9483ea81..a006e90db4 100644
--- a/ArmPkg/Library/BdsLib/BdsHelper.c
+++ b/ArmPkg/Library/BdsLib/BdsHelper.c
@@ -259,8 +259,14 @@ PrintPerformance (
UINTN Index;
CHAR8 Buffer[100];
UINTN CharCount;
+ BOOLEAN CountUp;
- TicksPerSecond = GetPerformanceCounterProperties (NULL, NULL);
+ TicksPerSecond = GetPerformanceCounterProperties (&Start, &Stop);
+ if (Start < Stop) {
+ CountUp = TRUE;
+ } else {
+ CountUp = FALSE;
+ }
TimeStamp = 0;
Key = 0;
@@ -269,7 +275,7 @@ PrintPerformance (
if (Key != 0) {
for (Index = 0; mTokenList[Index] != NULL; Index++) {
if (AsciiStriCmp (mTokenList[Index], Token) == 0) {
- Delta = Start - Stop;
+ Delta = CountUp?(Stop - Start):(Start - Stop);
TimeStamp += Delta;
Milliseconds = DivU64x64Remainder (MultU64x32 (Delta, 1000), TicksPerSecond, NULL);
CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"%6a %6ld ms\n", Token, Milliseconds);