require '_h2ph_pre.ph';

unless(defined(&_RF__RF_TIMER_H_)) {
    eval 'sub _RF__RF_TIMER_H_ () {1;}' unless defined(&_RF__RF_TIMER_H_);
    require 'rf_options.ph';
    require 'rf_utils.ph';
    require 'sys/time.ph';
    if(defined( &_KERNEL)) {
	require 'sys/kernel.ph';
	eval 'sub RF_ETIMER_START {
	    local($_t_) = @_;
    	    eval q({ \'int\'  &s;  &bzero(($_t_), $sizeof{$_t_});  &s =  &splclock(); ($_t_). &st =  &mono_time;  &splx( &s); });
	}' unless defined(&RF_ETIMER_START);
	eval 'sub RF_ETIMER_STOP {
	    local($_t_) = @_;
    	    eval q({ \'int\'  &s;  &s =  &splclock(); ($_t_). &et =  &mono_time;  &splx( &s); });
	}' unless defined(&RF_ETIMER_STOP);
	eval 'sub RF_ETIMER_EVAL {
	    local($_t_) = @_;
    	    eval q({  &RF_TIMEVAL_DIFF(($_t_). &st, ($_t_). &et, ($_t_). &diff) });
	}' unless defined(&RF_ETIMER_EVAL);
	eval 'sub RF_ETIMER_VAL_US {
	    local($_t_) = @_;
    	    eval q(( &RF_TIMEVAL_TO_US(($_t_). &diff)));
	}' unless defined(&RF_ETIMER_VAL_US);
	eval 'sub RF_ETIMER_VAL_MS {
	    local($_t_) = @_;
    	    eval q(( &RF_TIMEVAL_TO_US(($_t_). &diff)/1000));
	}' unless defined(&RF_ETIMER_VAL_MS);
    }
}
1;
