Estime User Guide

Estime: User Guide

Once installed (see the Installation Guide), the Estime library is easy to use. In order to use it in your C code, you have to include the header file <estime.h> and compile your code with the library option -lestime. The Estime package provides a few examples.


Function Calls

ESTIME * estime_init()
 Initialization step that must be performed once.
estime_t estime_get_time()
 Gets the current cycle count.
estime_t estime_get_virtual()
 Gets the virtual time of the own process.
ESTIME * estime_open(pid_t pid)
 Opens a timer for another process.
estime_t estime_get_pid_virtual(ESTIME *timer)
 Gets the virtual time of another process.
double estime_cycles_per_sec()
 Gets the number of cycles per second for this cpu.

estime_init

ESTIME * estime_init()

Initialization step that must be performed once.

Returns:
   the timer for this process or NULL on error

Effects:
   initializes the library internal structures


estime_get_time

estime_t estime_get_time()

Gets the current cycle count.

Returns:
   the current cycle count


estime_get_virtual

estime_t estime_get_virtual()

Gets the virtual time of the own process.

Returns:
   the virtual time in cycles for this process

Requires:
   estime_init() called


estime_open

ESTIME * estime_open(pid_t pid)

Opens a timer for another process.

Returns:
   a timer for the process identified by the given pid or NULL on error

Requires:
   pid refers to a live process


estime_get_pid_virtual

estime_t estime_get_pid_virtual(ESTIME *timer)

Gets the virtual time of another process.

Returns:
   the virtual time in cycles for the process of the given timer

Requires:
   estime_init() called && timer refers to a live process


estime_cycles_per_sec

double estime_cycles_per_sec()

Gets the number of cycles per second for this cpu.

Returns:
   the number of cycles per second for this cpu

Requires:
   estime_init() called


namin@users.sourceforge.net