Changeset 54281 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Feb 18, 2015 8:01:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstPrfRT.cpp
r53472 r54281 44 44 45 45 # define ITERATE(preexpr, expr, postexpr, cIterations) \ 46 for (i = 0, u64TotalTS = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \ 46 AssertCompile(((cIterations) % 8) == 0); \ 47 /* Min and max value. */ \ 48 for (i = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \ 47 49 { \ 48 50 { preexpr } \ … … 60 62 if (u64ElapsedTS > u64MaxTS) \ 61 63 u64MaxTS = u64ElapsedTS; \ 62 u64TotalTS += u64ElapsedTS; \ 64 } \ 65 { \ 66 /* Calculate a good average value (may be smaller than min). */ \ 67 i = (cIterations); \ 68 AssertRelease((i % 8) == 0); \ 69 { preexpr } \ 70 uint64_t u64StartTS = ASMReadTSC(); \ 71 while (i != 0) \ 72 { \ 73 { expr } \ 74 { expr } \ 75 { expr } \ 76 { expr } \ 77 { expr } \ 78 { expr } \ 79 { expr } \ 80 { expr } \ 81 i -= 8; \ 82 } \ 83 u64TotalTS = ASMReadTSC() - u64StartTS; \ 84 { postexpr } \ 85 i = (cIterations); \ 63 86 } 64 87 … … 107 130 * RTTimeNanoTS, RTTimeProgramNanoTS, RTTimeMilliTS, and RTTimeProgramMilliTS. 108 131 */ 109 ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, 1000000);132 ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, _1M * 32); 110 133 PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeNanoTS"); 111 134
Note:
See TracChangeset
for help on using the changeset viewer.