pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
1998-03-12
1998-03-12 21:43:40 by Per Hedbor <ph@opera.com>
67a577ae6403183fddc9f4e6aa06f0a3263e8210 (
15
lines) (+
11
/-
4
)
[
Show
|
Annotate
]
Branch:
7.9
Added option to gethrtime() to get nano-second time resolution
Rev: src/builtin_functions.c:1.80
4:
||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h"
-
RCSID("$Id: builtin_functions.c,v 1.
79
1998/03/
09
23
:
23
:
53
grubba
Exp $");
+
RCSID("$Id: builtin_functions.c,v 1.
80
1998/03/
12
21
:
43
:
40
per
Exp $");
#include "interpret.h" #include "svalue.h" #include "pike_macros.h"
2292:
void f_gethrtime(INT32 args) { pop_n_elems(args);
+
if(args)
+
push_int((INT32)(gethrtime()));
+
else
push_int((INT32)(gethrtime()/1000)); } #else
2300:
struct timeval tv; pop_n_elems(args); GETTIMEOFDAY(&tv);
+
if(args)
+
push_int((INT32)((tv.tv_sec *1000000) + tv.tv_usec)*1000);
+
else
push_int((INT32)((tv.tv_sec *1000000) + tv.tv_usec)); } #endif /* HAVE_GETHRVTIME */
2368:
{ init_operators();
-
add_efun("gethrtime", f_gethrtime,"function(void:int)", OPT_EXTERNAL_DEPEND);
+
add_efun("gethrtime", f_gethrtime,"function(
int|
void:int)", OPT_EXTERNAL_DEPEND);
#ifdef HAVE_GETHRVTIME add_efun("gethrvtime",f_gethrvtime,"function(void:int)",OPT_EXTERNAL_DEPEND);