libubx/trig_utils.c
int tstat_write(FILE *fp, struct ubx_tstat *stats)
{
	struct ubx_timespec avg;

	if (stats->cnt > 0) {
		ubx_ts_div(&stats->total, stats->cnt, &avg);

		fprintf(fp, FILE_FMT,
			stats->block_name, stats->cnt,
			ubx_ts_to_us(&stats->min),
			ubx_ts_to_us(&stats->max),
			ubx_ts_to_us(&avg));
	} else {
		fprintf(fp, "%s: cnt: 0 - no stats aquired\n", stats->block_name);
	}

	return 0;
}
/**
 * write timing statistics to file
 * @param trig_inf struct trig_info's content to write
 * @return 0 if OK, -1 if opening or writing file failed.
 */
write timing statistics to file
@param trig_inf struct trig_info's content to write
@return 0 if OK, -1 if opening or writing file failed.
write timing statistics to file @param trig_inf struct trig_info ' s content to write @return 0 if OK - 1 if opening or writing file failed .
int tstat_write(FILE *fp, struct ubx_tstat *stats)
{
	struct ubx_timespec avg;
	if (stats->cnt > 0) {
		ubx_ts_div(&stats->total, stats->cnt, &avg);
		fprintf(fp, FILE_FMT,
			stats->block_name, stats->cnt,
			ubx_ts_to_us(&stats->min),
			ubx_ts_to_us(&stats->max),
			ubx_ts_to_us(&avg));
	} else {
		fprintf(fp, "%s: cnt: 0 - no stats aquired\n", stats->block_name);
	}
	return 0;
}
int tstat_write ( FILE * fp , struct ubx_tstat * stats ) { struct ubx_timespec avg ; if ( stats -> cnt > 0 ) { ubx_ts_div ( & stats -> total , stats -> cnt , & avg ) ; fprintf ( fp , FILE_FMT , stats -> block_name , stats -> cnt , ubx_ts_to_us ( & stats -> min ) , ubx_ts_to_us ( & stats -> max ) , ubx_ts_to_us ( & avg ) ) ; } else { fprintf ( fp , " \n " , stats -> block_name ) ; } return 0 ; }
write timing statistics to file
 @param trig_inf struct trig_info's content to write
 @return 0 if OK, -1 if opening or writing file failed.
write timing statistics to file @param trig_inf struct trig_info ' s content to write @return 0 if OK - 1 if opening or writing file failed .