pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:7978:    *! @note    *! The actual accuracy on many systems is significantly less than    *! microseconds or nanoseconds. See @[System.REAL_TIME_RESOLUTION].    *!    *! @seealso    *! @[_disable_threads()], @[gethrtime()]    */   static void f_gethrdtime(INT32 args)   {    int nsec = args && !UNSAFE_IS_ZERO(Pike_sp-args); -  cpu_time_t time = threads_disabled_acc_time; -  pop_n_elems(args); -  +  cpu_time_t time; + #ifdef PIKE_THREADS +  time = threads_disabled_acc_time;    if (threads_disabled) {    time += get_real_time() - threads_disabled_start;    } -  + #else +  time = get_real_time(); + #endif +  pop_n_elems(args); +     if (nsec) {    push_int64(time);   #ifndef LONG_CPU_TIME    push_int(1000000000 / CPU_TIME_TICKS);    o_multiply();   #endif    } else {   #if CPU_TIME_TICKS_LOW > 1000000    push_int64(time / (CPU_TIME_TICKS / 1000000));   #else