Re: Question about GTK+ and timers



On Wed, Apr 6, 2011 at 2:49 PM, Igor Korot <ikorot01 gmail com> wrote:
> Hi, ALL,
> I read that the timer event processing is differ between x86 and ARM.
> On x86 it fires at 1/1000 interval, on ARM it fires at 10/1000
> interval.
>
> If I use g_timeout_add_seconds( 1, ...) am I guaranteed that the timer
> events will fire with 1 sec interval independently of the arch?

you're not guaranteed anything about timeouts. if you are relying on
them for precise timing, you've made a mistake already. within the
context of a GUI, with its (typically slow) human interaction times,
they are entirely accurate enough. for anything else, not at all.

the timeout will execute as part of the glib event loop that its a
part of. your callback could be delayed by arbitrary amounts of time
by other, higher priority callbacks.

however, if the interval is 1 second, then you can be assured that
your callback is almost certainly going to execute very, very close to
once every second.

--p


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]