summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-09-01 22:23:55 +0300
committerhv <hv@crypt.org>2002-09-04 12:55:54 +0000
commit5311654c160c66b924ce3fd64ced30ed3ff8a96b (patch)
treebf899a4c790a7ec28acd0573399f004bbf456476 /pp_sys.c
parent30d6fba6aa7467c9f9b076801c9a8093e7735500 (diff)
downloadperl-5311654c160c66b924ce3fd64ced30ed3ff8a96b.tar.gz
use sysconf(_SC_CLK_TCK) for times()
Message-ID: <20020901162355.GH12536@lyta.hut.fi> p4raw-id: //depot/perl@17833
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 54699c8841..9f15b0e924 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4351,26 +4351,6 @@ PP(pp_time)
RETURN;
}
-/* XXX The POSIX name is CLK_TCK; it is to be preferred
- to HZ. Probably. For now, assume that if the system
- defines HZ, it does so correctly. (Will this break
- on VMS?)
- Probably we ought to use _sysconf(_SC_CLK_TCK), if
- it's supported. --AD 9/96.
-*/
-
-#ifdef __BEOS__
-# define HZ 1000000
-#endif
-
-#ifndef HZ
-# ifdef CLK_TCK
-# define HZ CLK_TCK
-# else
-# define HZ 60
-# endif
-#endif
-
PP(pp_tms)
{
#ifdef HAS_TIMES
@@ -4384,11 +4364,11 @@ PP(pp_tms)
/* is returned. */
#endif
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_utime)/HZ)));
+ PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_utime)/(NV)PL_clocktick)));
if (GIMME == G_ARRAY) {
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_stime)/HZ)));
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cutime)/HZ)));
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cstime)/HZ)));
+ PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_stime)/(NV)PL_clocktick)));
+ PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cutime)/(NV)PL_clocktick)));
+ PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cstime)/(NV)PL_clocktick)));
}
RETURN;
#else