This is a draft; comments and suggestions are welcome.


PTR_Get_wall_interval - Calculate the interval between two wallclock timer values.
PTR_Get_usr_interval - Calculate the interval between two User CPU timer values.
PTR_Get_sys_interval - Calculate the interval between two System CPU timer values.

#include <ptools_ptr_c.h>

void PTR_Get_wall_interval(
PTR_wall_timer_val *wall_var1,
PTR_wall_timer_val *wall_var2,
double *wall_secs,
int *PTR_wall_stat );

void PTR_Get_usr_interval(
PTR_usr_timer_val *usr_var1,
PTR_usr_timer_val *usr_var2,
double *usr_secs,
int *PTR_usr_stat );

void PTR_Get_sys_interval(
PTR_sys_timer_val *sys_var1,
PTR_sys_timer_val *sys_var2,
double *sys_secs,
int *PTR_sys_stat );

NOTE: ??? refers to the prefix for any of the three timers: wallclock time (wall), user CPU time (usr), or system CPU time (sys).

These routines are used to calculate the time interval, in seconds, between two timer values. The overhead of converting the platform-dependent timer values and the calculation of the interval is encapsulated in these routines.

The first argument, ???_var1, is the timer value at the start of the interval being measured.

The second argument, ???_var2, is the timer value at the end of the interval being measured.

The third argument, ???_secs, is used to return the time interval between the two timer values, in seconds.

The fourth argument, PTR_???_stat, is used to return status information.

PTR_Init_wall_timer(3C), PTR_Init_usr_timer(3C), PTR_Init_sys_timer(3C), PTR_Get_wall_time(3C), PTR_Get_usr_time(3C), PTR_Get_sys_time(3C).

Switching the order of the timer values may give an PTR_ROLLOVER_DETECTED error.

For further information, contact kennino@cs.orst.edu.