Re: [AD] Add timeBeginPeriod(1) to wtimer.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2005-02-17 at 13:40 +0100, Evert Glebbeek wrote:
> > i looked at the src code, to find out about the WaitForSingleObject()
> >
> > how do you measure the results ?
>
> The proper way to do measurements would be to compare the benchmarks from
> the test programme that comes with Allegro, I think.
> If there's a clear difference there, then we can discuss if this really is
> a problem or not. For now, I'm leaning to just calling timeBeginPeriod()
> from within rest()...
>
Ideally, we would either find a document describing the implications of
timeBeginPeriod(1), or have some more test results.
I suspect (may be wrong though), that timeBeginPeriod(1) causes the
windows scheduler to be called 1000 times / second instead of just 100
times / second.. so some wasted CPU power and additional context
switches. Not sure what happens when it is called dynamically - probably
if a fixed-framerate game calls rest(1) periodically in its main loop to
give up CPU power - might as well just call timeBeginPeriod(1) once in
the beginning.
So, in short, the effect of timeBeginPeriod(1) certainly is wanted, the
more accurate timing functions are in Allegro, the better. There may
just a price to pay, the additional scheduler overhead - and depending
on how high it is, we might be better off not adding it at all.
--
Elias Pschernig