1-second events


(Berger, Daniel) #1

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
application.

Any ideas?

Thanks,

Paul

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.

Regards,

Dan