Changeset 10946 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 29, 2008 6:15:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstTimer.cpp
r10941 r10946 152 152 gu64Min = UINT64_MAX; 153 153 gu64Prev = 0; 154 rc = RTTimerCreate (&pTimer, aTests[i].uMilliesInterval, TimerCallback, NULL);154 rc = RTTimerCreateEx(&pTimer, aTests[i].uMilliesInterval * (uint64_t)1000000, 0, TimerCallback, NULL); 155 155 if (RT_FAILURE(rc)) 156 156 { 157 RTPrintf(" RTTimerCreate(,%d,) -> %d\n", aTests[i].uMilliesInterval, rc);157 RTPrintf("tstTimer: FAILURE - RTTimerCreateEx(,%u*1M,,,) -> %Rrc\n", aTests[i].uMilliesInterval, rc); 158 158 cErrors++; 159 159 continue; … … 161 161 162 162 /* 163 * Active waiting for 2 seconds and then destroy it.163 * Start the timer and active waiting for the requested test period. 164 164 */ 165 165 uint64_t uTSBegin = RTTimeNanoTS(); 166 rc = RTTimerStart(pTimer, 0); 167 if (RT_FAILURE(rc)) 168 { 169 RTPrintf("tstTimer: FAILURE - RTTimerStart(,0) -> %Rrc\n", aTests[i].uMilliesInterval, rc); 170 cErrors++; 171 } 172 166 173 while (RTTimeNanoTS() - uTSBegin < (uint64_t)aTests[i].uMilliesWait * 1000000) 167 174 /* nothing */; 175 176 /* destroy the timer */ 168 177 uint64_t uTSEnd = RTTimeNanoTS(); 169 178 uint64_t uTSDiff = uTSEnd - uTSBegin; 170 RTPrintf("uTS=%RI64 (%RU64 - %RU64)\n", uTSDiff, uTSBegin, uTSEnd);171 if (RT_FAILURE(rc))172 RTPrintf("warning: RTThreadSleep ended prematurely with %d\n", rc);173 179 rc = RTTimerDestroy(pTimer); 174 180 if (RT_FAILURE(rc)) … … 176 182 RTPrintf("tstTimer: FAILURE - RTTimerDestroy() -> %d gcTicks=%d\n", rc, gcTicks); 177 183 cErrors++; 178 continue; 179 } 184 } 185 186 RTPrintf("tstTimer: uTS=%RI64 (%RU64 - %RU64)\n", uTSDiff, uTSBegin, uTSEnd); 180 187 unsigned cTicks = gcTicks; 181 RTThreadSleep( 100);188 RTThreadSleep(aTests[i].uMilliesInterval * 3); 182 189 if (gcTicks != cTicks) 183 190 {
Note:
See TracChangeset
for help on using the changeset viewer.