From: Elias P. <eli...@gm...> - 2009-02-02 14:03:56
|
On Mon, 2009-02-02 at 16:20 +1100, AJ wrote: > and what is the resolution of thread context switches? > unless you specifically set it, it can be as much as 10ms. > > why are you using a thread as a timer... a thread is a thread, time > is time... threads vary execution time and speed constantly, and are > at the mercy of the workload, which changes every other instruction.... > i mean really.. what were you thinking... you want a consistant time > reading.. so want something with clock like accuracy... so you choice a > thread? user-space threads which in multi-threaded OS have some of the > most irratic timing. > > threads stall, start, stop, get thrown off the CPU, run on random cores, > change speed everytime the process gets it a boost.. hello! > > if you want the time accurately.. call a clock function.. you want high > performance clock, so call the QueryPerformaceCounter directly. > True. It's how it works in Allegro 5. With Allegro 4, you're stuck with though. -- Elias Pschernig <el...@us...> |