LIKWID
Classes | Functions
Time measurement module

Classes

struct  TimerData
 Struct defining the start and stop time of a time interval. More...
 
union  TscCounter
 Struct defining the start and stop time of a time interval. More...
 

Functions

void timer_finalize (void) __attribute__((visibility("default")))
 Finalize timer module. More...
 
uint64_t timer_getBaseline (void) __attribute__((visibility("default")))
 Return the baseline CPU clock determined at timer_init. More...
 
uint64_t timer_getCpuClock (void) __attribute__((visibility("default")))
 Return the CPU clock determined at timer_init. More...
 
uint64_t timer_getCpuClockCurrent (int cpu_id) __attribute__((visibility("default")))
 Return the current CPU clock read from sysfs. More...
 
uint64_t timer_getCycleClock (void) __attribute__((visibility("default")))
 Return the cycles clock determined at timer_init. More...
 
void timer_init (void) __attribute__((visibility("default")))
 Initialize timer by retrieving baseline frequency and cpu clock.
 
double timer_print (const TimerData *time) __attribute__((visibility("default")))
 Return the measured interval in seconds. More...
 
uint64_t timer_printCycles (const TimerData *time) __attribute__((visibility("default")))
 Return the measured interval in cycles. More...
 
void timer_reset (TimerData *time) __attribute__((visibility("default")))
 Reset values in TimerData. More...
 
int timer_sleep (unsigned long usec) __attribute__((visibility("default")))
 Sleep for specified usecs. More...
 
void timer_start (TimerData *time) __attribute__((visibility("default")))
 Start time measurement. More...
 
void timer_stop (TimerData *time) __attribute__((visibility("default")))
 Stop time measurement. More...
 

Detailed Description

Function Documentation

void timer_finalize ( void  )

Finalize timer module.

uint64_t timer_getBaseline ( void  )

Return the baseline CPU clock determined at timer_init.

Returns
Baseline CPU clock
uint64_t timer_getCpuClock ( void  )

Return the CPU clock determined at timer_init.

Returns
CPU clock
uint64_t timer_getCpuClockCurrent ( int  cpu_id)

Return the current CPU clock read from sysfs.

Returns
CPU clock
uint64_t timer_getCycleClock ( void  )

Return the cycles clock determined at timer_init.

Returns
cycle clock
double timer_print ( const TimerData time)

Return the measured interval in seconds.

Parameters
[in]timeStructure holding the cycle count at start and stop
Returns
Time in seconds
uint64_t timer_printCycles ( const TimerData time)

Return the measured interval in cycles.

Parameters
[in]timeStructure holding the cycle count at start and stop
Returns
Time in cycles
void timer_reset ( TimerData time)

Reset values in TimerData.

Parameters
[in]timeStructure holding the cycle count at start and stop
int timer_sleep ( unsigned long  usec)

Sleep for specified usecs.

Parameters
[in]usecAmount of usecs to sleep
void timer_start ( TimerData time)

Start time measurement.

Parameters
[in,out]timeStructure holding the cycle count at start
void timer_stop ( TimerData time)

Stop time measurement.

Parameters
[in,out]timeStructure holding the cycle count at stop