From: Steve Peters Date: Fri, 4 Nov 2005 12:02:51 +0000 (+0000) Subject: Upgrade to Time-HiRes-1.80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70cf0185be8a46ed25b37689143a5eb26c7909eb;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Time-HiRes-1.80 p4raw-id: //depot/perl@25985 --- diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes index 58e5be4..91abfe4 100644 --- a/ext/Time/HiRes/Changes +++ b/ext/Time/HiRes/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Time::HiRes. +1.80 [2005-10-04] + - Gisle noticed a mistake (using HAS_NANOSLEEP) in 1.79 + 1.79 [2005-10-03] - try nanosleep for emulating usleep -- may help in some weird embedded realtime places which have nanosleep but neither usleep diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index 54fe20d..6dac141 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -17,7 +17,7 @@ require DynaLoader; d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer d_nanosleep d_clock_gettime d_clock_getres); -$VERSION = '1.79'; +$VERSION = '1.80'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -119,8 +119,8 @@ C, and C/C calls. If your system lacks C or an emulation of it you don't get C or the one-argument form of C. -If your system lacks all of C, C, and -C, you don't get C, +If your system lacks all of C, C, C, +and C, you don't get C, C, or C. If your system lacks both C and C you don't get C or C. @@ -318,13 +318,13 @@ of C, see L. use Time::HiRes qw(usleep ualarm gettimeofday tv_interval); $microseconds = 750_000; - usleep $microseconds; + usleep($microseconds); # signal alarm in 2.5s & every .1s thereafter - ualarm 2_500_000, 100_000; + ualarm(2_500_000, 100_000); # get seconds and microseconds since the epoch - ($s, $usec) = gettimeofday; + ($s, $usec) = gettimeofday(); # measure elapsed time # (could also do by subtracting 2 gettimeofday return values) diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index 666de93..2463531 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -361,7 +361,8 @@ gettimeofday (struct timeval *tp, void *tpz) /* Do not use H A S _ N A N O S L E E P - * so that Perl Configure doesn't scan for it. + * so that Perl Configure doesn't scan for it (and pull in -lrt and + * the like which are not usually good ideas for the default Perl). * (We are part of the core perl now.) * The TIME_HIRES_NANOSLEEP is set by Makefile.PL. */ #if !defined(HAS_USLEEP) && defined(TIME_HIRES_NANOSLEEP) @@ -409,7 +410,7 @@ hrt_usleep(unsigned long usec) } #endif /* #if !defined(HAS_USLEEP) && defined(WIN32) */ -#if !defined(HAS_USLEEP) && defined(HAS_NANOSLEEP) +#if !defined(HAS_USLEEP) && defined(TIME_HIRES_NANOSLEEP) #define HAS_USLEEP #define usleep hrt_usleep /* could conflict with ncurses for static build */