On 07/20/2010 01:06 AM, Louigi Verona wrote:
Hey guys!
Some time ago I have asked someone to look into Kluppe and add a couple of
features.
My request was not ignored and Patrick Shirkey was kind enough to volunteer
to try to help.
However, he came upon a difficulty and that is - *how do you set up an
asynchronous timer in C?*
It depends what you need that timer for.
In gtk there's a g_timeout_add(). easy to use.
To writing your own:
`apropos pthread` and more specifically `man pthread_create`.
usleep() sleeps at least, and select() sleeps at most a certain period
of time.
http://freej.dyne.org/codedoc/fps_8cpp_source.html line 132ff
has examples of both.
For [more] accurate timing: RTC or HPET. Example code comes
with the kernel:
linux-2.6/Documentation/rtc.txt
linux-2.6/Documentation/hpet.txt
There's a couple of other options fi. if you want to sync
hardware-devices using IRQs.. and the jack_process_callback is also very
good timer :)
It stopped right there. I was wondering if anyone
could help us with that
matter?
Cheers!
--
Robin Gareus mail: robin(a)gareus.org
site:
http://gareus.org/ chat: xmpp:rgareus@ik.nu
blog:
http://rg42.org/ lab :
http://citu.fr/
Public Key at
http://pgp.mit.edu/
Fingerprint : 7107 840B 4DC9 C948 076D 6359 7955 24F1 4F95 2B42