Branch: Tag:

1997-05-07

1997-05-07 06:27:32 by Per Hedbor <ph@opera.com>

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

4:   ||| 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:    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);    add_efun("add_constant",f_add_constant,"function(string,void|mixed:void)",OPT_SIDE_EFFECT);