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.477 2005/04/21 15:45:06 mast Exp $ + || $Id: builtin_functions.c,v 1.478 2006/01/11 04:46:52 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.477 2005/04/21 15:45:06 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.478 2006/01/11 04:46:52 mast Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:2157:    *!    *! 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()]    */   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);