litl 0.1.9
Loading...
Searching...
No Matches
litl_timer.h File Reference

litl_timer Provides a set of functions for measuring time More...

#include "litl_types.h"

Go to the source code of this file.

Typedefs

typedef litl_time_t(* litl_timing_method_t) ()
 A callback function that returns the current time in ns. It can be either a pointer to one of the timing functions provided by LiTL or a user-defined function.
 

Functions

void litl_time_initialize ()
 Initializes the timing mechanism.
 
int litl_set_timing_method (litl_timing_method_t callback)
 Selects the timing function to use.
 
litl_time_t litl_get_time_monotonic_raw ()
 Uses clock_gettime(CLOCK_MONOTONIC_RAW)
 
litl_time_t litl_get_time_monotonic ()
 Uses clock_gettime(CLOCK_MONOTONIC)
 
litl_time_t litl_get_time_realtime ()
 Uses clock_gettime(CLOCK_REALTIME)
 
litl_time_t litl_get_time_process_cputime ()
 Uses clock_gettime(CLOCK_PROCESS_CPUTIME)
 
litl_time_t litl_get_time_thread_cputime ()
 Uses clock_gettime(CLOCK_THREAD_CPUTIME)
 
litl_time_t litl_get_time_ticks ()
 Uses CPU-specific register (for instance, rdtsc for X86* processors)
 
litl_time_t litl_get_time_none ()
 Ultra-fast measurement function.
 

Variables

litl_timing_method_t litl_get_time
 Calls the selected timing method and get the current time in ns.
 

Detailed Description

litl_timer Provides a set of functions for measuring time

Authors
Developers are :
Roman Iakymchuk – roman.nosp@m..iak.nosp@m.ymchu.nosp@m.k@te.nosp@m.lecom.nosp@m.-sud.nosp@m.paris.nosp@m..eu
Francois Trahay – franc.nosp@m.ois..nosp@m.traha.nosp@m.y@te.nosp@m.lecom.nosp@m.-sud.nosp@m.paris.nosp@m..eu

Definition in file litl_timer.h.