pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.77 2002/02/21 05:29:13 per-bash Exp $ +  * $Id: builtin.cmod,v 1.78 2002/02/21 05:45:19 per-bash Exp $    */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:1873:    {    THIS->hard_update = !fast;    }   }      PIKECLASS Timer   {    CVAR struct timeval last_time;    CVAR int hard_update;    -  PIKEFUN float get( ) +  +  PIKEFUN float peek( )    {    extern struct timeval current_time;    FLOAT_TYPE res;    if( THIS->hard_update )    gettimeofday( &current_time, 0 );    res = current_time.tv_sec-THIS->last_time.tv_sec +    (current_time.tv_usec-THIS->last_time.tv_usec)/1000000.0; -  THIS->last_time = current_time; +     RETURN res;    }    -  +  PIKEFUN float get( ) +  { +  extern struct timeval current_time; +  f_Timer_peek( 0 ); +  THIS->last_time = current_time; +  return; +  } +     PIKEFUN void create( int|void fast )    {    extern struct timeval current_time;    THIS->hard_update = !fast;    if( THIS->hard_update )    gettimeofday( &current_time, 0 );    THIS->last_time = current_time;    }   }