pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.601 2005/11/19 17:14:35 grubba Exp $ + || $Id: builtin_functions.c,v 1.602 2006/01/11 04:46:52 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:2494:    *! The third syntax can be used to measure time more preciely than one    *! second. It return how many seconds has passed since @[t]. The precision    *! of this function varies from system to system.    *!    *! @seealso    *! @[ctime()], @[localtime()], @[mktime()], @[gmtime()],    *! @[System.gettimeofday], @[gethrtime]    */   PMOD_EXPORT void f_time(INT32 args)   { -  if(!args) +  if(!args || (Pike_sp[-args].type == T_INT && Pike_sp[-args].u.integer == 0))    {    GETTIMEOFDAY(&current_time);    }else{    if(Pike_sp[-args].type == T_INT && Pike_sp[-args].u.integer > 1)    {    struct timeval tmp;    GETTIMEOFDAY(&current_time);    tmp.tv_sec=Pike_sp[-args].u.integer;    tmp.tv_usec=0;    my_subtract_timeval(&tmp,&current_time);