VirtualBox

Changeset 54281 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 18, 2015 8:01:37 PM (10 years ago)
Author:
vboxsync
Message:

tstPrfRT tweaking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstPrfRT.cpp

    r53472 r54281  
    4444
    4545# 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++) \
    4749    { \
    4850        { preexpr } \
     
    6062        if (u64ElapsedTS > u64MaxTS) \
    6163            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); \
    6386    }
    6487
     
    107130     * RTTimeNanoTS, RTTimeProgramNanoTS, RTTimeMilliTS, and RTTimeProgramMilliTS.
    108131     */
    109     ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, 1000000);
     132    ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, _1M * 32);
    110133    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeNanoTS");
    111134
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette