diff --git a/src/builtin_functions.c b/src/builtin_functions.c index b88904a358132f09455adcb6268056aa5c380285..2279f3ee24c176fe73f50d674515cf6a94757cca 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.35 1997/04/16 03:09:09 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.36 1997/05/07 06:27:32 per Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -1663,9 +1663,30 @@ void f_replace_master(INT32 args) pop_n_elems(args); } +#ifdef HAVE_GETHRVTIME +#include <sys/time.h> + +void f_gethrvtime(INT32 args) +{ + pop_n_elems(args); + push_int((INT32)((gethrvtime())/1000)); +} + +void f_gethrtime(INT32 args) +{ + pop_n_elems(args); + push_int((INT32)((gethrtime())/1000)); +} +#endif + void init_builtin_efuns() { init_operators(); + +#ifdef HAVE_GETHRVTIME + add_efun("gethrvtime",f_gethrvtime,"function(void:int)",OPT_EXTERNAL_DEPEND); + add_efun("gethrtime", f_gethrtime,"function(void:int)", OPT_EXTERNAL_DEPEND); +#endif add_efun("_refs",f__refs,"function(function|string|array|mapping|multiset|object|program:int)",OPT_EXTERNAL_DEPEND); add_efun("replace_master",f_replace_master,"function(object:void)",OPT_SIDE_EFFECT); diff --git a/src/configure.in b/src/configure.in index 3c7b62b93638b40a98ffe0e9668cff4eaae88f74..c56aee0cbc152c122227746547742f8949886c83 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1,4 +1,4 @@ -AC_REVISION("$Id: configure.in,v 1.92 1997/04/23 01:59:40 hubbe Exp $") +AC_REVISION("$Id: configure.in,v 1.93 1997/05/07 06:27:30 per Exp $") AC_INIT(interpret.c) AC_CONFIG_HEADER(machine.h) @@ -653,6 +653,9 @@ AC_CHECK_FUNCS( clock \ crypt \ fchmod \ + gethrtime \ + gethrvtime \ + frexp \ getenv \ getrlimit \ getrusage \