This is a FAQ :

C:\>perldoc -q alarm
Found in C:\Perl\lib\pod\perlfaq8.pod
  How can I sleep() or alarm() for under a second?

            If you want finer granularity than the 1 second that the sleep()
            function provides, the easiest way is to use the select()
            function as documented in the section on "select" in the
            perlfunc manpage. Try the Time::HiRes and the BSD::Itimer
            modules (available from CPAN).


C:\>

I always avoid as much as I can, re-inventing the wheel :-),
so look and see if Time::HiRes module is helpful for what you need.

http://search.cpan.org/author/JHI/Time-HiRes-1.42/HiRes.pm#SYNOPSIS

HTH,

José.

> -----Original Message-----
> From: Angerstein [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, February 10, 2003 12:42 PM
> To: Mailinglist Perl Beginners
> Subject: How to alarm under 1 second?
> 
> 
> Hello,
> 
> I have aquestions.
> 
> If I need an alarm signal alarm(), in less than 1 second what 
> can I do?
> 
> Would that work?
> 
> sub selfalarm {
>   $waittime = @_;
>   if ($pid = fork){
>  
>   } else {
>     $ppid = getppid();
>     select (undef,undef,undef, $waittime);
>     kill 14 => ppid;  
>   }
>   
> }
> 
> SIG{ALRM} = sub {die;}
> 
> $c = 0;
> eval {
>   &selfalarm("0.1");
>   $c++;
> };
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to