pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
1999-10-31
1999-10-31 15:29:51 by Henrik Grubbström (Grubba) <grubba@grubba.org>
cbbff87767447b7ed2d22028c5c8a8ed9983c7a3 (
20
lines) (+
14
/-
6
)
[
Show
|
Annotate
]
Branch:
7.9
gethr{,v}time() now knows about INT64.
Rev: src/builtin_functions.c:1.198
5:
\*/ /**/ #include "global.h"
-
RCSID("$Id: builtin_functions.c,v 1.
197
1999/10/
29
03
:
35
:
31
mast
Exp $");
+
RCSID("$Id: builtin_functions.c,v 1.
198
1999/10/
31
15
:
29
:
51
grubba
Exp $");
#include "interpret.h" #include "svalue.h" #include "pike_macros.h"
3813:
void f_gethrvtime(INT32 args) { pop_n_elems(args);
-
push_
int
(
(INT32)(
gethrvtime()/1000)
)
;
+
push_
int64
(gethrvtime()/1000);
} void f_gethrtime(INT32 args) { pop_n_elems(args); if(args)
-
push_
int
(
(INT32)(
gethrtime())
)
;
+
push_
int64
(gethrtime());
else
-
push_
int
(
(INT32)(
gethrtime()/1000)
)
;
+
push_
int64
(gethrtime()/1000);
} #else void f_gethrtime(INT32 args)
3830:
struct timeval tv; pop_n_elems(args); GETTIMEOFDAY(&tv);
+
#ifdef INT64
if(args)
-
push_
int
((
INT32)
((tv.tv_sec *1000000) + tv.tv_usec)*1000);
+
push_
int64
((((
INT64)
tv.tv_sec *
1000000) + tv.tv_usec)*1000);
else
-
push_
int
((
INT32
)((tv.tv_sec *1000000) + tv.tv_usec));
+
push_
int64
((
(INT64
)
tv.tv_sec * 1000000) + tv.tv_usec));
+
#else /* !INT64 */
+
if
(
args)
+
push_int64
(
((
tv.tv_sec *
1000000) + tv.tv_usec)
*1000
);
+
else
+
push_int64((tv.tv_sec * 1000000) + tv.tv_usec));
+
#endif /* INT64 */
} #endif /* HAVE_GETHRVTIME */