天行健,君子以自强不息!
发布时间:2013-03-12 14:57:40
一、ALARM方式示例程序:#!/usr/bin/perl$timeout = 2 ;while(1){ eval { local $SIG{ALRM} = sub{print "sorry,time out.please try again\n"} ; alarm $timeout ; #启动定时器 # 实际操作 print "hello world!\n" ; sleep 3 .........【阅读全文】
发布时间:2013-03-12 14:16:38
use strict ;use Time::HiRes qw(gettimeofday) ;sub Test{ # sec: seconds # usec: microsecond my ($start_sec, $start_usec) = gettimeofday() ; #======================# # Place your code here!# #==.........【阅读全文】