litl  0.1.9
litl_timer.h
Go to the documentation of this file.
1 /* -*- c-file-style: "GNU" -*- */
2 /*
3  * Copyright © Télécom SudParis.
4  * See COPYING in top-level directory.
5  */
6 
7 #ifndef LITL_TIMER_H_
8 #define LITL_TIMER_H_
9 
20 #include "litl_types.h"
21 
43 
49 
55 
63 
64 // Pre-defined timing methods:
65 
73 
80 
87 
94 
101 
108 
115 
116 #endif /* LITL_TIMER_H_ */
void litl_time_initialize()
Initializes the timing mechanism.
Definition: litl_timer.c:138
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 tim...
Definition: litl_timer.h:42
int litl_set_timing_method(litl_timing_method_t callback)
Selects the timing function to use.
Definition: litl_timer.c:197
litl_time_t litl_get_time_none()
Ultra-fast measurement function.
Definition: litl_timer.c:285
litl_timing_method_t litl_get_time
Calls the selected timing method and get the current time in ns.
Definition: litl_timer.c:37
litl_time_t litl_get_time_ticks()
Uses CPU-specific register (for instance, rdtsc for X86* processors)
Definition: litl_timer.c:295
litl_time_t litl_get_time_monotonic()
Uses clock_gettime(CLOCK_MONOTONIC)
Definition: litl_timer.c:236
litl_time_t litl_get_time_monotonic_raw()
Uses clock_gettime(CLOCK_MONOTONIC_RAW)
Definition: litl_timer.c:223
litl_time_t litl_get_time_realtime()
Uses clock_gettime(CLOCK_REALTIME)
Definition: litl_timer.c:249
litl_time_t litl_get_time_thread_cputime()
Uses clock_gettime(CLOCK_THREAD_CPUTIME)
Definition: litl_timer.c:275
litl_time_t litl_get_time_process_cputime()
Uses clock_gettime(CLOCK_PROCESS_CPUTIME)
Definition: litl_timer.c:262
uint64_t litl_time_t
A data type for storing time stamps.
Definition: litl_types.h:114
litl_types Provides a set of data structures for recording and reading events as well as merging and ...