in reply to timeout for ?

What would the best way of incorporating Time::HiRes be? I could think of forking off a child who would be in charge of generating the alarm signal (using kill) to the parent, after sleeping for a time using the Time::HiRes sleep function.

This feels like a clunky solution, so is there a way for a Perl script to ask the OS for a signal with better resolution?

Also, alarm() is sadly unimplemented on Windows NT, which is (idem) the OS I'm currently using. Thanks!

Greg

Replies are listed 'Best First'.
RE: Re: timeout for ?
by tye (Sage) on Aug 29, 2000 at 22:53 UTC

    Time::HiRes includes ualarm(), so no need to roll your own.

    For WinNT, I was going to relunctantly suggest Win32::Console but it doesn't seem to offer this like I thought it did. (Reluctantly, not because it is a yucky module (it is well made), but because I hate resorting to such OS-specific modules -- and it only works for reading from consoles.) I'd love to hear of a more portable solution that works on NT.

            - tye (but my friends call me "Tye")