]> Pileus Git - ~andy/csm213a-hw/blob - hw2/main_time.h
Add readme and cleanup formatting cleanup
[~andy/csm213a-hw] / hw2 / main_time.h
1 #ifndef MAIN_TIME_H
2 #define MAIN_TIME_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9
10 /* Constants */
11 #define NSEC_PER_SEC 1000000000ULL
12
13 /* Initialization */
14 void time_init(void);
15
16 /* Time conversion functions */
17 uint64_t time_to_world(uint64_t local);
18 uint64_t time_to_local(uint64_t world);
19
20 /* External time synchronization */
21 void time_ext_init(uint64_t local, uint64_t world);
22 void time_ext_sync(uint64_t local, uint64_t world);
23
24 /* Helper functions */
25 void time_printf(const char *label, uint64_t local);
26
27 #ifdef __cplusplus
28 }
29 #endif
30
31 #endif