New Timebase
To allow more accurate timing in wait, R3 uses a different timebase than R2.
In R3, we use the QueryPerformanceCounter() method of timing and a continuous delta time is computed during the event processing of the wait.
The current time resolution is 1 millisecond (.001).
We can increase the resolution if we need to, but I don't see the benefit because most operating systems are not real-time. Between device overhead and timeslicing, we are lucky to get within a millisecond at all. (However, I should note that the R3 event/timer design is much more efficient and streamlined compared to R2.)
The code that handles timing is in the open source R3 API, so it can be adjusted as necessary. There are a few items we will need to consider:
- An equivalent of QueryPerformanceCounter will be needed for non MS systems such as OSX, Linux, cellphones, etc. (At worst case, we can use tick time as in R2, which is only about .02 resolution).
- QueryPerformanceCounter may not exist on older hardware. So, #1 may be required if that condition is detected.
- Regardless, we assume the CPU overhead of whatever method is used is extremely low.
10 Comments
|