libjf API reference guide

Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

jf_timer.h File Reference

#include <jf/jf_config.h>

Go to the source code of this file.

Data Structures

struct  jf_timer_t

Defines

#define JF_FEATURE_TIMER_ACTIVE   "no"
#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_TIMER

Functions

double jf_timer_get_ela_time (const jf_timer_t *t)
double jf_timer_get_sys_time (const jf_timer_t *t)
double jf_timer_get_usr_time (const jf_timer_t *t)
int jf_timer_reset (jf_timer_t *t)
int jf_timer_start (jf_timer_t *t)
int jf_timer_stop (jf_timer_t *t)

Variables

const char * jf_feature_timer


Define Documentation

#define JF_FEATURE_TIMER_ACTIVE   "no"
 

Definition at line 56 of file jf_timer.h.

#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_TIMER
 

Definition at line 48 of file jf_timer.h.


Function Documentation

double jf_timer_get_ela_time const jf_timer_t t  )  [inline, static]
 

Retrieve elapsed time expressed in seconds

Parameters:
t IN timer object
Returns:
elapsed time (secs)
Definition at line 187 of file jf_timer.h.

References jf_timer_t::ela_time.

Referenced by bench_test_results_compute_one().

double jf_timer_get_sys_time const jf_timer_t t  )  [inline, static]
 

Retrieve system used time expressed in seconds

Parameters:
t IN timer object
Returns:
system used time (secs)
Definition at line 172 of file jf_timer.h.

References jf_timer_t::sys_time, and jf_timer_t::ticks_per_sec.

Referenced by bench_test_results_compute_one().

double jf_timer_get_usr_time const jf_timer_t t  )  [inline, static]
 

Retrieve user used time expressed in seconds

Parameters:
t IN timer object
Returns:
user used time (secs)
Definition at line 157 of file jf_timer.h.

References jf_timer_t::ticks_per_sec, and jf_timer_t::usr_time.

Referenced by bench_test_results_compute_one().

int jf_timer_reset jf_timer_t t  ) 
 

Reset the timer: this method must be invoked before the timer can be started/stopped

Parameters:
t OUT timer object
Returns:
a reason code
Definition at line 42 of file jf_timer.c.

References jf_timer_t::base_ela_time, jf_timer_t::base_sys_time, jf_timer_t::base_usr_time, CATCH, jf_timer_t::ela_time, FALSE, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_RC_SYSCONF_ERROR, JF_RC_UNSUPPORTED_FUNCTION, JF_TRACE, jf_timer_t::started, jf_timer_t::sys_time, THROW, jf_timer_t::ticks_per_sec, jf_timer_t::tz, and jf_timer_t::usr_time.

Referenced by bench_test_results_compute_one().

int jf_timer_start jf_timer_t t  ) 
 

Start a timer: elapsed time and CPU time will be registered

Parameters:
t IN/OUT timer object
Returns:
a reason code
Definition at line 88 of file jf_timer.c.

References jf_timer_t::base_ela_time, jf_timer_t::base_sys_time, jf_timer_t::base_usr_time, CATCH, JF_RC_GETTIMEOFDAY_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_INVALID_STATUS, JF_RC_OK, JF_RC_TIMES_ERROR, JF_RC_UNSUPPORTED_FUNCTION, JF_TRACE, jf_timer_t::started, THROW, TRUE, and jf_timer_t::tz.

Referenced by bench_test_results_compute_one().

int jf_timer_stop jf_timer_t t  ) 
 

Stop a timer: the timer must be started before it must be stopped!

Parameters:
t IN/OUT timer object
Returns:
a reason code
Definition at line 148 of file jf_timer.c.

References jf_timer_t::base_ela_time, jf_timer_t::base_sys_time, jf_timer_t::base_usr_time, CATCH, jf_timer_t::ela_time, FALSE, JF_RC_GETTIMEOFDAY_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_INVALID_STATUS, JF_RC_OK, JF_RC_TIMES_ERROR, JF_RC_UNSUPPORTED_FUNCTION, JF_TRACE, jf_timer_t::started, jf_timer_t::sys_time, THROW, jf_timer_t::tz, and jf_timer_t::usr_time.

Referenced by bench_test_results_compute_one().


Variable Documentation

const char* jf_feature_timer
 

This constant is used to define the symbol jf_feature_timer in the resulting object/library Definition at line 38 of file jf_timer.c.


Copyright 2005 © Tiian