M
Michael Evans
First, we rely on a stable update rate so that our physics and dynamics
calculations and integrations are based on a known interval and
therefore are true-to-life.
Second, the graphics positions in our image generators are updated by
this dynamics application, and we need to update them at the rate they
are being refreshed so that we don't get any stutter from frames being
used twice or having to be thrown out.
Without microsecond timing resolution in some form, it is impossible to
get even close to the desired update rate. For example, 60 Hz would
require a frame interval of 0.016666 seconds, but with only millisecond
resolution, you can only time either 0.016 or 0.017 seconds. These
intervals give you either 62.50 Hz or 58.82 Hz.
We are familiar with the concept of using a hardware device to generate
a high resolution interrupt to trigger an ISR that runs our application
frame. But we are looking for a software alternative so that we don't
need extra hardware in the machine just for that purpose.
We have also tried using the millisecond timer rounded down to the
nearest whole millisecond, and then spinning in a while loop until the
remainder of the interval has elapsed, but this causes CPU usage to at
least double.
calculations and integrations are based on a known interval and
therefore are true-to-life.
Second, the graphics positions in our image generators are updated by
this dynamics application, and we need to update them at the rate they
are being refreshed so that we don't get any stutter from frames being
used twice or having to be thrown out.
Without microsecond timing resolution in some form, it is impossible to
get even close to the desired update rate. For example, 60 Hz would
require a frame interval of 0.016666 seconds, but with only millisecond
resolution, you can only time either 0.016 or 0.017 seconds. These
intervals give you either 62.50 Hz or 58.82 Hz.
We are familiar with the concept of using a hardware device to generate
a high resolution interrupt to trigger an ISR that runs our application
frame. But we are looking for a software alternative so that we don't
need extra hardware in the machine just for that purpose.
We have also tried using the millisecond timer rounded down to the
nearest whole millisecond, and then spinning in a while loop until the
remainder of the interval has elapsed, but this causes CPU usage to at
least double.