libs/gen/src/time_log.cxx
//------------------------------------------
// The following routine calculates the difference (in seconds) between
// two time_log events, allowing for wraparound in the seconds fields
//------------------------------------------
The following routine calculates the difference (in seconds) between
two time_log events, allowing for wraparound in the seconds fields
The following routine calculates the difference ( in seconds ) between two time_log events allowing for wraparound in the seconds fields
static float time_diff(time_log* start, time_log* end) {
   entry_exit_time stime = start->get_time();
   entry_exit_time etime = end->get_time();
   float diff = int(etime.sec) - int(stime.sec) +
	 (int(etime.usec) - int(stime.usec)) / 1e6;
   if (diff < 0.0)
      diff += 2048.0;   
   diff += 43e-6;	
   return diff;
}
static float time_diff ( time_log * start , time_log * end ) { entry_exit_time stime = start -> get_time ( ) ; entry_exit_time etime = end -> get_time ( ) ; float diff = int ( etime . sec ) - int ( stime . sec ) + ( int ( etime . usec ) - int ( stime . usec ) ) / 1e6 ; if ( diff < 0.0 ) diff += 2048.0 ; diff += 43e-6 ; return diff ; }
The following routine calculates the difference (in seconds) between
two time_log events, allowing for wraparound in the seconds fields
The following routine calculates the difference ( in seconds ) between two time_log events allowing for wraparound in the seconds fields
// assumes 11-bit field for seconds // add fudge for pre-Initialize/post-Return overhead