libjf API reference guide

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

jf_timer.c File Reference

#include <jf/jf_config.h>
#include <jf/jf_errors.h>
#include <jf/jf_timer.h>
#include <jf/jf_trace.h>

Go to the source code of this file.

Defines

#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_TIMER

Functions

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 = "feature/timer = " JF_FEATURE_TIMER_ACTIVE


Define Documentation

#define JF_TRACE_MODULE   JF_TRACE_MOD_LIB_TIMER
 

Definition at line 34 of file jf_timer.c.


Function Documentation

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 = "feature/timer = " JF_FEATURE_TIMER_ACTIVE
 

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