diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-28 11:41:34 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-28 11:41:34 +0000 |
commit | 5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2 (patch) | |
tree | 1a5f88e1885451d633737f44ad3082ea09891e01 /ArmPkg/Library/BdsLib | |
parent | 8ca6180f216a0ff558919643a512563f4478fe8d (diff) | |
download | edk2-5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2.zip edk2-5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2.tar.gz edk2-5b491514ecfefc9a4b11cac789ec3a8e5b8f13f2.tar.bz2 |
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/Library/BdsLib')
-rw-r--r-- | ArmPkg/Library/BdsLib/BdsHelper.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsHelper.c b/ArmPkg/Library/BdsLib/BdsHelper.c index fa9483e..a006e90 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); |