Revision history for Perl extension Time::HiRes.
+1.79 [2005-10-03]
+ - try nanosleep for emulating usleep -- may help in some weird
+ embedded realtime places which have nanosleep but neither usleep
+ nor select nor poll (doesn't have to be weird embedded realtime
+ place, though -- in many places usleep is nanosleep anyway)
+ - try poll for emulating usleep -- this may help some obscure/old
+ SVR4 places that have neither usleep nor select
+ - a redundant test guard in HiRes.t
+
1.78 [2005-10-03]
- ITIMER_VIRTUAL detection in HiRes.t had problems (that we cannot
- in the general case fail already at 'use' is suboptimal)
+ in the general case fail already at 'use' phase is suboptimal)
- fixes to the documentation of clock_gettime() and clock_getres()
1.77 [2005-10-03]
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
d_nanosleep d_clock_gettime d_clock_getres);
-$VERSION = '1.78';
+$VERSION = '1.79';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
/* Do not use H A S _ N A N O S L E E P
* so that Perl Configure doesn't scan for it.
+ * (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)
#define HAS_USLEEP
}
#endif /* #if !defined(HAS_USLEEP) && defined(WIN32) */
+#if !defined(HAS_USLEEP) && defined(HAS_NANOSLEEP)
+#define HAS_USLEEP
+#define usleep hrt_usleep /* could conflict with ncurses for static build */
+
+void
+hrt_usleep(unsigned long usec)
+{
+ struct timespec tsa;
+ tsa.tv_sec = usec * 1000; /* Ignoring wraparound. */
+ tsa.tv_nsec = 0;
+ nanosleep(&tsa, NULL);
+}
+
+#endif /* #if !defined(HAS_USLEEP) && defined(HAS_POLL) */
+
+#if !defined(HAS_USLEEP) && defined(HAS_POLL)
+#define HAS_USLEEP
+#define usleep hrt_usleep /* could conflict with ncurses for static build */
+
+void
+hrt_usleep(unsigned long usec)
+{
+ int msec = usec / 1000;
+ poll(0, 0, msec);
+}
+
+#endif /* #if !defined(HAS_USLEEP) && defined(HAS_POLL) */
#if !defined(HAS_UALARM) && defined(HAS_SETITIMER)
#define HAS_UALARM