Branch: Tag:

1999-10-31

1999-10-31 15:29:51 by Henrik Grubbström (Grubba) <grubba@grubba.org>

gethr{,v}time() now knows about INT64.

Rev: src/builtin_functions.c:1.198

5:   \*/   /**/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.197 1999/10/29 03:35:31 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.198 1999/10/31 15:29:51 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
3813:   void f_gethrvtime(INT32 args)   {    pop_n_elems(args); -  push_int((INT32)(gethrvtime()/1000)); +  push_int64(gethrvtime()/1000);   }      void f_gethrtime(INT32 args)   {    pop_n_elems(args);    if(args) -  push_int((INT32)(gethrtime())); +  push_int64(gethrtime());    else -  push_int((INT32)(gethrtime()/1000)); +  push_int64(gethrtime()/1000);   }   #else   void f_gethrtime(INT32 args)
3830:    struct timeval tv;    pop_n_elems(args);    GETTIMEOFDAY(&tv); + #ifdef INT64    if(args) -  push_int((INT32)((tv.tv_sec *1000000) + tv.tv_usec)*1000); +  push_int64((((INT64)tv.tv_sec * 1000000) + tv.tv_usec)*1000);    else -  push_int((INT32)((tv.tv_sec *1000000) + tv.tv_usec)); +  push_int64(((INT64)tv.tv_sec * 1000000) + tv.tv_usec)); + #else /* !INT64 */ +  if(args) +  push_int64(((tv.tv_sec * 1000000) + tv.tv_usec)*1000); +  else +  push_int64((tv.tv_sec * 1000000) + tv.tv_usec)); + #endif /* INT64 */   }   #endif /* HAVE_GETHRVTIME */