Export epoch time via proc_global_info (XCC)
[akaros.git] / user / parlib / include / parlib / timing.h
1 #pragma once
2
3 #include <stdint.h>
4 #include <parlib/tsc-compat.h>
5
6 __BEGIN_DECLS
7
8 uint64_t udelay(uint64_t usec);
9 uint64_t ndelay(uint64_t nsec);
10 uint64_t udiff(uint64_t begin, uint64_t end);
11 uint64_t ndiff(uint64_t begin, uint64_t end);
12
13 /* Conversion btw tsc ticks and time units.  From Akaros's kern/src/time.c */
14 uint64_t tsc2sec(uint64_t tsc_time);
15 uint64_t tsc2msec(uint64_t tsc_time);
16 uint64_t tsc2usec(uint64_t tsc_time);
17 uint64_t tsc2nsec(uint64_t tsc_time);
18 uint64_t sec2tsc(uint64_t sec);
19 uint64_t msec2tsc(uint64_t msec);
20 uint64_t usec2tsc(uint64_t usec);
21 uint64_t nsec2tsc(uint64_t nsec);
22 uint64_t nsec(void);
23
24 uint64_t epoch_nsec_to_tsc(uint64_t epoch_ns);
25 uint64_t tsc_to_epoch_nsec(uint64_t tsc);
26 uint64_t epoch_nsec(void);
27
28 __END_DECLS