Skip to content
Snippets Groups Projects
Commit 9548a899 authored by Per Hedbor's avatar Per Hedbor
Browse files

Two new functions: gethrtime() and gethrvtime(). Returns time down to cycle...

Two new functions: gethrtime() and gethrvtime(). Returns time down to cycle precision on sparcs. Used by gauge

Rev: src/builtin_functions.c:1.36
Rev: src/configure.in:1.93
parent 4868dbbe
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
||| See the files COPYING and DISCLAIMER for more information. ||| See the files COPYING and DISCLAIMER for more information.
\*/ \*/
#include "global.h" #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 "interpret.h"
#include "svalue.h" #include "svalue.h"
#include "pike_macros.h" #include "pike_macros.h"
...@@ -1663,10 +1663,31 @@ void f_replace_master(INT32 args) ...@@ -1663,10 +1663,31 @@ void f_replace_master(INT32 args)
pop_n_elems(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() void init_builtin_efuns()
{ {
init_operators(); 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("_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); add_efun("replace_master",f_replace_master,"function(object:void)",OPT_SIDE_EFFECT);
add_efun("add_constant",f_add_constant,"function(string,void|mixed:void)",OPT_SIDE_EFFECT); add_efun("add_constant",f_add_constant,"function(string,void|mixed:void)",OPT_SIDE_EFFECT);
......
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_INIT(interpret.c)
AC_CONFIG_HEADER(machine.h) AC_CONFIG_HEADER(machine.h)
...@@ -653,6 +653,9 @@ AC_CHECK_FUNCS( ...@@ -653,6 +653,9 @@ AC_CHECK_FUNCS(
clock \ clock \
crypt \ crypt \
fchmod \ fchmod \
gethrtime \
gethrvtime \
frexp \
getenv \ getenv \
getrlimit \ getrlimit \
getrusage \ getrusage \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment