4 #define PERL_NO_GET_CONTEXT
9 #if defined(__CYGWIN__) && defined(HAS_W32API_WINDOWS_H)
10 # include <w32api/windows.h>
11 # define CYGWIN_WITH_W32API
16 # include <sys/time.h>
20 # include <sys/select.h>
27 #ifndef PerlProc_pause
28 # define PerlProc_pause() Pause()
34 # undef Pause /* In case perl.h did it already. */
35 # define Pause() sleep(~0) /* Zzz for a long time. */
38 /* Though the cpp define ITIMER_VIRTUAL is available the functionality
39 * is not supported in Cygwin as of August 2004, ditto for Win32.
40 * Neither are ITIMER_PROF or ITIMER_REALPROF implemented. --jhi
42 #if defined(__CYGWIN__) || defined(WIN32)
43 # undef ITIMER_VIRTUAL
45 # undef ITIMER_REALPROF
48 /* 5.004 doesn't define PL_sv_undef */
49 #ifndef ATLEASTFIVEOHOHFIVE
51 # define PL_sv_undef sv_undef
55 #include "const-c.inc"
57 #if defined(WIN32) || defined(CYGWIN_WITH_W32API)
59 #ifndef HAS_GETTIMEOFDAY
60 # define HAS_GETTIMEOFDAY
63 /* shows up in winsock.h?
71 unsigned __int64 ft_i64;
75 #define MY_CXT_KEY "Time::HiRes_" XS_VERSION
78 unsigned long run_count;
79 unsigned __int64 base_ticks;
80 unsigned __int64 tick_frequency;
81 FT_t base_systime_as_filetime;
82 unsigned __int64 reset_time;
87 /* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */
89 # define Const64(x) x##LL
91 # define Const64(x) x##i64
93 #define EPOCH_BIAS Const64(116444736000000000)
95 /* NOTE: This does not compute the timezone info (doing so can be expensive,
96 * and appears to be unsupported even by glibc) */
98 /* dMY_CXT needs a Perl context and we don't want to call PERL_GET_CONTEXT
99 for performance reasons */
102 #define gettimeofday(tp, not_used) _gettimeofday(aTHX_ tp, not_used)
104 /* If the performance counter delta drifts more than 0.5 seconds from the
105 * system time then we recalibrate to the system time. This means we may
106 * move *backwards* in time! */
107 #define MAX_PERF_COUNTER_SKEW Const64(5000000) /* 0.5 seconds */
109 /* Reset reading from the performance counter every five minutes.
110 * Many PC clocks just seem to be so bad. */
111 #define MAX_PERF_COUNTER_TICKS Const64(300000000) /* 300 seconds */
114 _gettimeofday(pTHX_ struct timeval *tp, void *not_used)
118 unsigned __int64 ticks;
121 if (MY_CXT.run_count++ == 0 ||
122 MY_CXT.base_systime_as_filetime.ft_i64 > MY_CXT.reset_time) {
123 QueryPerformanceFrequency((LARGE_INTEGER*)&MY_CXT.tick_frequency);
124 QueryPerformanceCounter((LARGE_INTEGER*)&MY_CXT.base_ticks);
125 GetSystemTimeAsFileTime(&MY_CXT.base_systime_as_filetime.ft_val);
126 ft.ft_i64 = MY_CXT.base_systime_as_filetime.ft_i64;
127 MY_CXT.reset_time = ft.ft_i64 + MAX_PERF_COUNTER_TICKS;
131 QueryPerformanceCounter((LARGE_INTEGER*)&ticks);
132 ticks -= MY_CXT.base_ticks;
133 ft.ft_i64 = MY_CXT.base_systime_as_filetime.ft_i64
134 + Const64(10000000) * (ticks / MY_CXT.tick_frequency)
135 +(Const64(10000000) * (ticks % MY_CXT.tick_frequency)) / MY_CXT.tick_frequency;
136 diff = ft.ft_i64 - MY_CXT.base_systime_as_filetime.ft_i64;
137 if (diff < -MAX_PERF_COUNTER_SKEW || diff > MAX_PERF_COUNTER_SKEW) {
138 MY_CXT.base_ticks += ticks;
139 GetSystemTimeAsFileTime(&MY_CXT.base_systime_as_filetime.ft_val);
140 ft.ft_i64 = MY_CXT.base_systime_as_filetime.ft_i64;
144 /* seconds since epoch */
145 tp->tv_sec = (long)((ft.ft_i64 - EPOCH_BIAS) / Const64(10000000));
147 /* microseconds remaining */
148 tp->tv_usec = (long)((ft.ft_i64 / Const64(10)) % Const64(1000000));
154 #if defined(WIN32) && !defined(ATLEASTFIVEOHOHFIVE)
156 sleep(unsigned int t)
163 #if !defined(HAS_GETTIMEOFDAY) && defined(VMS)
164 #define HAS_GETTIMEOFDAY
167 #include <time.h> /* gettimeofday */
168 #include <stdlib.h> /* qdiv */
169 #include <starlet.h> /* sys$gettim */
172 #include <lib$routines.h> /* lib$ediv() */
176 VMS binary time is expressed in 100 nano-seconds since
177 system base time which is 17-NOV-1858 00:00:00.00
180 #define DIV_100NS_TO_SECS 10000000L
181 #define DIV_100NS_TO_USECS 10L
184 gettimeofday is supposed to return times since the epoch
185 so need to determine this in terms of VMS base time
187 static $DESCRIPTOR(dscepoch,"01-JAN-1970 00:00:00.00");
190 static long base_adjust[2]={0L,0L};
192 static __int64 base_adjust=0;
197 If we don't have gettimeofday, then likely we are on a VMS machine that
198 operates on local time rather than UTC...so we have to zone-adjust.
199 This code gleefully swiped from VMS.C
202 /* method used to handle UTC conversions:
203 * 1 == CRTL gmtime(); 2 == SYS$TIMEZONE_DIFFERENTIAL; 3 == no correction
205 static int gmtime_emulation_type;
206 /* number of secs to add to UTC POSIX-style time to get local time */
207 static long int utc_offset_secs;
208 static struct dsc$descriptor_s fildevdsc =
209 { 12, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$FILE_DEV" };
210 static struct dsc$descriptor_s *fildev[] = { &fildevdsc, NULL };
212 static time_t toutc_dst(time_t loc) {
215 if ((rsltmp = localtime(&loc)) == NULL) return -1;
216 loc -= utc_offset_secs;
217 if (rsltmp->tm_isdst) loc -= 3600;
221 static time_t toloc_dst(time_t utc) {
224 utc += utc_offset_secs;
225 if ((rsltmp = localtime(&utc)) == NULL) return -1;
226 if (rsltmp->tm_isdst) utc += 3600;
230 #define _toutc(secs) ((secs) == (time_t) -1 ? (time_t) -1 : \
231 ((gmtime_emulation_type || timezone_setup()), \
232 (gmtime_emulation_type == 1 ? toutc_dst(secs) : \
233 ((secs) - utc_offset_secs))))
235 #define _toloc(secs) ((secs) == (time_t) -1 ? (time_t) -1 : \
236 ((gmtime_emulation_type || timezone_setup()), \
237 (gmtime_emulation_type == 1 ? toloc_dst(secs) : \
238 ((secs) + utc_offset_secs))))
245 if (gmtime_emulation_type == 0) {
247 time_t base = 15 * 86400; /* 15jan71; to avoid month/year ends between */
248 /* results of calls to gmtime() and localtime() */
251 gmtime_emulation_type++;
252 if ((tm_p = gmtime(&base)) == NULL) { /* CRTL gmtime() is a fake */
253 char off[LNM$C_NAMLENGTH+1];;
255 gmtime_emulation_type++;
256 if (!Perl_vmstrnenv("SYS$TIMEZONE_DIFFERENTIAL",off,0,fildev,0)) {
257 gmtime_emulation_type++;
259 Perl_warn(aTHX_ "no UTC offset information; assuming local time is UTC");
261 else { utc_offset_secs = atol(off); }
263 else { /* We've got a working gmtime() */
264 struct tm gmt, local;
267 tm_p = localtime(&base);
269 utc_offset_secs = (local.tm_mday - gmt.tm_mday) * 86400;
270 utc_offset_secs += (local.tm_hour - gmt.tm_hour) * 3600;
271 utc_offset_secs += (local.tm_min - gmt.tm_min) * 60;
272 utc_offset_secs += (local.tm_sec - gmt.tm_sec);
280 gettimeofday (struct timeval *tp, void *tpz)
286 long div_100ns_to_secs;
287 long div_100ns_to_usecs;
295 In case of error, tv_usec = 0 and tv_sec = VMS condition code.
296 The return from function is also set to -1.
297 This is not exactly as per the manual page.
303 if (base_adjust[0]==0 && base_adjust[1]==0) {
305 if (base_adjust==0) { /* Need to determine epoch adjustment */
307 ret=sys$bintim(&dscepoch,&base_adjust);
308 if (1 != (ret &&1)) {
314 ret=sys$gettim(&quad); /* Get VMS system time */
315 if ((1 && ret) == 1) {
317 quad[0] -= base_adjust[0]; /* convert to epoch offset */
318 quad[1] -= base_adjust[1]; /* convert 2nd half of quadword */
319 div_100ns_to_secs = DIV_100NS_TO_SECS;
320 div_100ns_to_usecs = DIV_100NS_TO_USECS;
321 lib$ediv(&div_100ns_to_secs,&quad,&quo,&rem);
324 lib$ediv(&div_100ns_to_usecs,&quad1,&quo1,&rem1);
325 tp->tv_sec = quo; /* Whole seconds */
326 tp->tv_usec = quo1; /* Micro-seconds */
328 quad -= base_adjust; /* convert to epoch offset */
329 ans1=qdiv(quad,DIV_100NS_TO_SECS);
330 ans2=qdiv(ans1.rem,DIV_100NS_TO_USECS);
331 tp->tv_sec = ans1.quot; /* Whole seconds */
332 tp->tv_usec = ans2.quot; /* Micro-seconds */
340 if (VMSISH_TIME) tp->tv_sec = _toloc(tp->tv_sec);
342 if (!VMSISH_TIME) tp->tv_sec = _toutc(tp->tv_sec);
350 /* Do not use H A S _ N A N O S L E E P
351 * so that Perl Configure doesn't scan for it.
352 * The TIME_HIRES_NANOSLEEP is set by Makefile.PL. */
353 #if !defined(HAS_USLEEP) && defined(TIME_HIRES_NANOSLEEP)
355 #define usleep hrt_unanosleep /* could conflict with ncurses for static build */
358 hrt_unanosleep(unsigned long usec) /* This is used to emulate usleep. */
361 res.tv_sec = usec/1000/1000;
362 res.tv_nsec = ( usec - res.tv_sec*1000*1000 ) * 1000;
363 nanosleep(&res, NULL);
366 #endif /* #if !defined(HAS_USLEEP) && defined(TIME_HIRES_NANOSLEEP) */
368 #if !defined(HAS_USLEEP) && defined(HAS_SELECT)
369 #ifndef SELECT_IS_BROKEN
371 #define usleep hrt_usleep /* could conflict with ncurses for static build */
374 hrt_usleep(unsigned long usec)
379 select(0, (Select_fd_set_t)NULL, (Select_fd_set_t)NULL,
380 (Select_fd_set_t)NULL, &tv);
383 #endif /* #if !defined(HAS_USLEEP) && defined(HAS_SELECT) */
385 #if !defined(HAS_USLEEP) && defined(WIN32)
387 #define usleep hrt_usleep /* could conflict with ncurses for static build */
390 hrt_usleep(unsigned long usec)
396 #endif /* #if !defined(HAS_USLEEP) && defined(WIN32) */
399 #if !defined(HAS_UALARM) && defined(HAS_SETITIMER)
401 #define ualarm hrt_ualarm /* could conflict with ncurses for static build */
404 hrt_ualarm(int usec, int interval)
406 struct itimerval itv;
407 itv.it_value.tv_sec = usec / 1000000;
408 itv.it_value.tv_usec = usec % 1000000;
409 itv.it_interval.tv_sec = interval / 1000000;
410 itv.it_interval.tv_usec = interval % 1000000;
411 return setitimer(ITIMER_REAL, &itv, 0);
413 #endif /* #if !defined(HAS_UALARM) && defined(HAS_SETITIMER) */
415 #if !defined(HAS_UALARM) && defined(VMS)
417 #define ualarm vms_ualarm
419 #include <lib$routines.h>
427 #define VMSERR(s) (!((s)&1))
430 us_to_VMS(useconds_t mseconds, unsigned long v[])
439 iss = lib$addx(qq,qq,qq);
440 if (VMSERR(iss)) lib$signal(iss);
441 iss = lib$subx(v,qq,v);
442 if (VMSERR(iss)) lib$signal(iss);
443 iss = lib$addx(qq,qq,qq);
444 if (VMSERR(iss)) lib$signal(iss);
445 iss = lib$subx(v,qq,v);
446 if (VMSERR(iss)) lib$signal(iss);
447 iss = lib$subx(v,qq,v);
448 if (VMSERR(iss)) lib$signal(iss);
452 VMS_to_us(unsigned long v[])
455 unsigned long div=10,quot, rem;
457 iss = lib$ediv(&div,v,",&rem);
458 if (VMSERR(iss)) lib$signal(iss);
463 typedef unsigned short word;
464 typedef struct _ualarm {
467 unsigned long delay[2];
468 unsigned long interval[2];
469 unsigned long remain[2];
474 static Alarm *a0, alarm_base;
479 static void ualarm_AST(Alarm *a);
482 vms_ualarm(int mseconds, int interval)
491 static struct item_list3 itmlst[2];
492 static int first = 1;
498 itmlst[0].code = JPI$_ASTEN;
499 itmlst[0].length = sizeof(asten);
500 itmlst[0].retlenaddr = NULL;
502 itmlst[1].length = 0;
503 itmlst[1].bufaddr = NULL;
504 itmlst[1].retlenaddr = NULL;
506 iss = lib$get_ef(&alarm_ef);
507 if (VMSERR(iss)) lib$signal(iss);
510 a0->function = UAL_NULL;
512 itmlst[0].bufaddr = &asten;
514 iss = sys$getjpiw(0,0,0,itmlst,0,0,0);
515 if (VMSERR(iss)) lib$signal(iss);
516 if (!(asten&0x08)) return -1;
520 a->function = UAL_SET;
522 a->function = UAL_CLEAR;
525 us_to_VMS(mseconds, a->delay);
527 us_to_VMS(interval, a->interval);
532 iss = sys$clref(alarm_ef);
533 if (VMSERR(iss)) lib$signal(iss);
535 iss = sys$dclast(ualarm_AST,a,0);
536 if (VMSERR(iss)) lib$signal(iss);
538 iss = sys$waitfr(alarm_ef);
539 if (VMSERR(iss)) lib$signal(iss);
541 if (a->function == UAL_ACTIVE)
542 return VMS_to_us(a->remain);
553 unsigned long now[2];
555 iss = sys$gettim(now);
556 if (VMSERR(iss)) lib$signal(iss);
558 if (a->function == UAL_SET || a->function == UAL_CLEAR) {
559 if (a0->function == UAL_ACTIVE) {
560 iss = sys$cantim(a0,PSL$C_USER);
561 if (VMSERR(iss)) lib$signal(iss);
563 iss = lib$subx(a0->remain, now, a->remain);
564 if (VMSERR(iss)) lib$signal(iss);
566 if (a->remain[1] & 0x80000000)
567 a->remain[0] = a->remain[1] = 0;
570 if (a->function == UAL_SET) {
571 a->function = a0->function;
572 a0->function = UAL_ACTIVE;
573 a0->repeat = a->repeat;
575 a0->interval[0] = a->interval[0];
576 a0->interval[1] = a->interval[1];
578 a0->delay[0] = a->delay[0];
579 a0->delay[1] = a->delay[1];
581 iss = lib$subx(now, a0->delay, a0->remain);
582 if (VMSERR(iss)) lib$signal(iss);
584 iss = sys$setimr(0,a0->delay,ualarm_AST,a0);
585 if (VMSERR(iss)) lib$signal(iss);
587 a->function = a0->function;
588 a0->function = UAL_NULL;
590 iss = sys$setef(alarm_ef);
591 if (VMSERR(iss)) lib$signal(iss);
592 } else if (a->function == UAL_ACTIVE) {
594 iss = lib$subx(now, a->interval, a->remain);
595 if (VMSERR(iss)) lib$signal(iss);
597 iss = sys$setimr(0,a->interval,ualarm_AST,a);
598 if (VMSERR(iss)) lib$signal(iss);
600 a->function = UAL_NULL;
603 if (VMSERR(iss)) lib$signal(iss);
604 lib$signal(SS$_ASTFLT);
606 lib$signal(SS$_BADPARAM);
610 #endif /* #if !defined(HAS_UALARM) && defined(VMS) */
612 #ifdef HAS_GETTIMEOFDAY
615 myU2time(pTHX_ UV *ret)
619 status = gettimeofday (&Tp, NULL);
633 status = gettimeofday (&Tp, NULL);
634 return status == 0 ? Tp.tv_sec + (Tp.tv_usec / 1000000.) : -1.0;
637 #endif /* #ifdef HAS_GETTIMEOFDAY */
639 MODULE = Time::HiRes PACKAGE = Time::HiRes
648 #ifdef ATLEASTFIVEOHOHFIVE
649 #ifdef HAS_GETTIMEOFDAY
652 hv_store(PL_modglobal, "Time::NVtime", 12, newSViv(PTR2IV(myNVtime)), 0);
653 if (myU2time(aTHX_ auv) == 0)
654 hv_store(PL_modglobal, "Time::U2time", 12, newSViv((IV) auv[0]), 0);
660 #if defined(USE_ITHREADS) && defined(MY_CXT_KEY)
669 INCLUDE: const-xs.inc
671 #if defined(HAS_USLEEP) && defined(HAS_GETTIMEOFDAY)
677 struct timeval Ta, Tb;
679 gettimeofday(&Ta, NULL);
681 if (useconds > 1E6) {
682 IV seconds = (IV) (useconds / 1E6);
683 /* If usleep() has been implemented using setitimer()
684 * then this contortion is unnecessary-- but usleep()
685 * may be implemented in some other way, so let's contort. */
688 useconds -= 1E6 * seconds;
690 } else if (useconds < 0.0)
691 croak("Time::HiRes::usleep(%"NVgf"): negative time not invented yet", useconds);
692 usleep((U32)useconds);
695 gettimeofday(&Tb, NULL);
697 printf("[%ld %ld] [%ld %ld]\n", Tb.tv_sec, Tb.tv_usec, Ta.tv_sec, Ta.tv_usec);
699 RETVAL = 1E6*(Tb.tv_sec-Ta.tv_sec)+(NV)((IV)Tb.tv_usec-(IV)Ta.tv_usec);
704 #if defined(TIME_HIRES_NANOSLEEP)
710 struct timeval Ta, Tb;
712 gettimeofday(&Ta, NULL);
715 if (nseconds > 1E9) {
716 IV seconds = (IV) (nseconds / 1E9);
719 nseconds -= 1E9 * seconds;
721 } else if (nseconds < 0.0)
722 croak("Time::HiRes::nanosleep(%"NVgf"): negative time not invented yet", nseconds);
723 tsa.tv_sec = (IV) (nseconds / 1E9);
724 tsa.tv_nsec = (IV) nseconds - tsa.tv_sec * 1E9;
725 nanosleep(&tsa, NULL);
728 gettimeofday(&Tb, NULL);
729 RETVAL = 1E3*(1E6*(Tb.tv_sec-Ta.tv_sec)+(NV)((IV)Tb.tv_usec-(IV)Ta.tv_usec));
734 #endif /* #if defined(TIME_HIRES_NANOSLEEP) */
739 struct timeval Ta, Tb;
741 gettimeofday(&Ta, NULL);
743 NV seconds = SvNV(ST(0));
744 if (seconds >= 0.0) {
745 UV useconds = (UV)(1E6 * (seconds - (UV)seconds));
748 if ((IV)useconds < 0) {
749 #if defined(__sparc64__) && defined(__GNUC__)
750 /* Sparc64 gcc 2.95.3 (e.g. on NetBSD) has a bug
751 * where (0.5 - (UV)(0.5)) will under certain
752 * circumstances (if the double is cast to UV more
753 * than once?) evaluate to -0.5, instead of 0.5. */
754 useconds = -(IV)useconds;
755 #endif /* #if defined(__sparc64__) && defined(__GNUC__) */
756 if ((IV)useconds < 0)
757 croak("Time::HiRes::sleep(%"NVgf"): internal error: useconds < 0 (unsigned %"UVuf" signed %"IVdf")", seconds, useconds, (IV)useconds);
761 croak("Time::HiRes::sleep(%"NVgf"): negative time not invented yet", seconds);
764 gettimeofday(&Tb, NULL);
766 printf("[%ld %ld] [%ld %ld]\n", Tb.tv_sec, Tb.tv_usec, Ta.tv_sec, Ta.tv_usec);
768 RETVAL = (NV)(Tb.tv_sec-Ta.tv_sec)+0.000001*(NV)(Tb.tv_usec-Ta.tv_usec);
773 #endif /* #if defined(HAS_USLEEP) && defined(HAS_GETTIMEOFDAY) */
778 ualarm(useconds,interval=0)
782 if (useconds < 0 || interval < 0)
783 croak("Time::HiRes::ualarm(%d, %d): negative time not invented yet", useconds, interval);
784 RETVAL = ualarm(useconds, interval);
790 alarm(seconds,interval=0)
794 if (seconds < 0.0 || interval < 0.0)
795 croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): negative time not invented yet", seconds, interval);
796 RETVAL = (NV)ualarm(seconds * 1000000,
797 interval * 1000000) / 1E6;
802 #endif /* #ifdef HAS_UALARM */
804 #ifdef HAS_GETTIMEOFDAY
805 # ifdef MACOS_TRADITIONAL /* fix epoch TZ and use unsigned time_t */
813 status = gettimeofday (&Tp, &Tz);
814 Tp.tv_sec += Tz.tz_minuteswest * 60; /* adjust for TZ */
816 if (GIMME == G_ARRAY) {
818 /* Mac OS (Classic) has unsigned time_t */
819 PUSHs(sv_2mortal(newSVuv(Tp.tv_sec)));
820 PUSHs(sv_2mortal(newSViv(Tp.tv_usec)));
823 PUSHs(sv_2mortal(newSVnv(Tp.tv_sec + (Tp.tv_usec / 1000000.0))));
833 status = gettimeofday (&Tp, &Tz);
834 Tp.tv_sec += Tz.tz_minuteswest * 60; /* adjust for TZ */
835 RETVAL = Tp.tv_sec + (Tp.tv_usec / 1000000.0);
839 # else /* MACOS_TRADITIONAL */
846 status = gettimeofday (&Tp, NULL);
847 if (GIMME == G_ARRAY) {
849 PUSHs(sv_2mortal(newSViv(Tp.tv_sec)));
850 PUSHs(sv_2mortal(newSViv(Tp.tv_usec)));
853 PUSHs(sv_2mortal(newSVnv(Tp.tv_sec + (Tp.tv_usec / 1000000.0))));
862 status = gettimeofday (&Tp, NULL);
863 RETVAL = Tp.tv_sec + (Tp.tv_usec / 1000000.);
867 # endif /* MACOS_TRADITIONAL */
868 #endif /* #ifdef HAS_GETTIMEOFDAY */
870 #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER)
872 #define TV2NV(tv) ((NV)((tv).tv_sec) + 0.000001 * (NV)((tv).tv_usec))
875 setitimer(which, seconds, interval = 0)
880 struct itimerval newit;
881 struct itimerval oldit;
883 if (seconds < 0.0 || interval < 0.0)
884 croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", (IV)which, seconds, interval);
885 newit.it_value.tv_sec = seconds;
886 newit.it_value.tv_usec =
887 (seconds - (NV)newit.it_value.tv_sec) * 1000000.0;
888 newit.it_interval.tv_sec = interval;
889 newit.it_interval.tv_usec =
890 (interval - (NV)newit.it_interval.tv_sec) * 1000000.0;
891 if (setitimer(which, &newit, &oldit) == 0) {
893 PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_value))));
894 if (GIMME == G_ARRAY) {
896 PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_interval))));
904 struct itimerval nowit;
906 if (getitimer(which, &nowit) == 0) {
908 PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_value))));
909 if (GIMME == G_ARRAY) {
911 PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_interval))));
915 #endif /* #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER) */