| 57 | } |
| 58 | |
| 59 | const S32 getElapsedMs() |
| 60 | { |
| 61 | if(mUsingPerfCounter) |
| 62 | { |
| 63 | // Use QPC, update remainders so we don't leak time, and return the elapsed time. |
| 64 | QueryPerformanceCounter( (LARGE_INTEGER *) &mPerfCountNext); |
| 65 | F64 elapsedF64 = (1000.0 * F64(mPerfCountNext - mPerfCountCurrent) / F64(mFrequency)); |
| 66 | elapsedF64 += mPerfCountRemainderCurrent; |
| 67 | U32 elapsed = (U32)mFloor(elapsedF64); |
| 68 | mPerfCountRemainderNext = elapsedF64 - F64(elapsed); |
| 69 | |
| 70 | return elapsed; |
| 71 | } |
| 72 | else |
| 73 | { |
| 74 | // Do something naive with GTC. |
| 75 | mTickCountNext = GetTickCount(); |
| 76 | return mTickCountNext - mTickCountCurrent; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | void reset() |
| 81 | { |
no test coverage detected