litl  0.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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 
109 #endif /* LITL_TIMER_H_ */
litl_time_t litl_get_time_process_cputime()
Uses clock_gettime(CLOCK_PROCESS_CPUTIME)
Definition: litl_timer.c:212
litl_time_t litl_get_time_realtime()
Uses clock_gettime(CLOCK_REALTIME)
Definition: litl_timer.c:199
litl_time_t litl_get_time_thread_cputime()
Uses clock_gettime(CLOCK_THREAD_CPUTIME)
Definition: litl_timer.c:225
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
litl_time_t litl_get_time_monotonic_raw()
Uses clock_gettime(CLOCK_MONOTONIC_RAW)
Definition: litl_timer.c:173
litl_timing_method_t litl_get_time
Calls the selected timing method and get the current time in ns.
Definition: litl_timer.c:33
litl_time_t litl_get_time_ticks()
Uses CPU-specific register (for instance, rdtsc for X86* processors)
Definition: litl_timer.c:238
litl_time_t litl_get_time_monotonic()
Uses clock_gettime(CLOCK_MONOTONIC)
Definition: litl_timer.c:186
litl_types Provides a set of data structures for recording and reading events as well as merging and ...
void litl_time_initialize()
Initializes the timing mechanism.
Definition: litl_timer.c:99
int litl_set_timing_method(litl_timing_method_t callback)
Selects the timing function to use.
Definition: litl_timer.c:154
uint64_t litl_time_t
A data type for storing time stamps.
Definition: litl_types.h:112