1-second events

I need to create an event that occurs exactly once per second.
(Understanding that this is impossible on Linux, I’m willing
to accept a
solution that will average to exactly one event per second over the
course of a day). Someone on irc suggested writing an extension that
calls setitimer, but 1) I’ve never used setitimer, so I don’t
know what
kinds of problems I might run into, and 2) I’d like a solution that
doesn’t rely on SIGALRM, since that limits me to one timer per

Any ideas?



I’ve never looked at the internals of Time::HiRes (a Perl module), but it
may be worth looking at (and perhaps a port is in order).

You can find it at search.cpan.org.