Branch: Tag:

1998-02-10

1998-02-10 15:45:52 by Per Hedbor <ph@opera.com>

Added gethrtime() even when gethrtime(2) does not exist

Rev: src/builtin_functions.c:1.68

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.67 1998/02/01 07:07:37 hubbe Exp $"); + RCSID("$Id: builtin_functions.c,v 1.68 1998/02/10 15:45:52 per Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
1749:    pop_n_elems(args);    push_int((INT32)(gethrtime()/1000));   } + #else + void f_gethrtime(INT32 args) + { +  struct timeval tv; +  pop_n_elems(args); +  GETTIMEOFDAY(&tv); +  push_int((INT32)((tv.tv_sec *1000000) + tv.tv_usec)); + }   #endif /* HAVE_GETHRVTIME */      #ifdef PROFILING
1815:   {    init_operators();    +  add_efun("gethrtime", f_gethrtime,"function(void:int)", OPT_EXTERNAL_DEPEND); +    #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      #ifdef PROFILING