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.514 2003/10/30 19:33:26 nilsson Exp $ + || $Id: builtin_functions.c,v 1.515 2003/10/31 15:09:24 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.514 2003/10/30 19:33:26 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.515 2003/10/31 15:09:24 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:2156:       exit(Pike_sp[-args].u.integer);   }      /*! @decl int time();    *! @decl int time(int(1..1) one)    *! @decl float time(int(2..) t)    *!    *! This function returns the number of seconds since 00:00:00 UTC, 1 Jan 1970.    *! -  *! The second syntax does not call the system call @[time()] as often, -  *! but is only updated in the backed (when Pike code isn't running). +  *! The second syntax does not query the system for the current +  *! time. Instead the latest done by the pike process is returned +  *! again. That's slightly faster but can be wildly inaccurate. Pike +  *! queries the time internally when a thread has waited for +  *! something, typically in @[sleep] or in a backend (see +  *! @[Pike.Backend]).    *!    *! 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)
pike.git/src/builtin_functions.c:3508:      /*! @decl void sleep(int|float s, void|int abort_on_signal)    *!    *! This function makes the program stop for @[s] seconds.    *!    *! Only signal handlers can interrupt the sleep, and only when    *! @[abort_on_signal] is set. If more than one thread is running    *! the signal must be sent to the sleeping thread. Other callbacks    *! are not called during sleep.    *! +  *! If @[s] is zero then this thread will yield to other threads but +  *! not sleep otherwise. Note that Pike yields internally at regular +  *! intervals so it's normally not necessary to do this. +  *!    *! @seealso    *! @[signal()], @[delay()]    */   PMOD_EXPORT void f_sleep(INT32 args)   {   #ifdef HAVE_GETHRTIME    hrtime_t t0,tv;   #else    struct timeval t0,tv;   #endif