78ad5269a2a870d9a68b24105ae340194cefc8c7
[perl.git] / do / tms
1 int
2 do_tms(TARG,gimme,arglast)
3 STR *TARG;
4 int gimme;
5 int *arglast;
6 {
7 #ifdef MSDOS
8     return -1;
9 #else
10     STR **st = stack->ary_array;
11     register int sp = arglast[0];
12
13     if (gimme != G_ARRAY) {
14         str_sset(TARG,&str_undef);
15         STABSET(TARG);
16         st[++sp] = TARG;
17         return sp;
18     }
19     (void)times(&timesbuf);
20
21 #ifndef HZ
22 #define HZ 60
23 #endif
24
25 #ifndef lint
26     (void)astore(stack,++sp,
27       str_2mortal(str_nmake(((double)timesbuf.tms_utime)/HZ)));
28     (void)astore(stack,++sp,
29       str_2mortal(str_nmake(((double)timesbuf.tms_stime)/HZ)));
30     (void)astore(stack,++sp,
31       str_2mortal(str_nmake(((double)timesbuf.tms_cutime)/HZ)));
32     (void)astore(stack,++sp,
33       str_2mortal(str_nmake(((double)timesbuf.tms_cstime)/HZ)));
34 #else
35     (void)astore(stack,++sp,
36       str_2mortal(str_nmake(0.0)));
37 #endif
38     return sp;
39 #endif
40 }
41