Module/UDI - Implementing parts of MEI (abusing CPP for fun and profit)
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / udi_lib / time.c
1 /**
2  * \file time.c
3  * \author John Hodge (thePowersGang)
4  */
5 #include <acess.h>
6 #include <udi.h>
7
8 // === EXPORTS ===
9 EXPORT(udi_timer_start);
10 EXPORT(udi_timer_start_repeating);
11 EXPORT(udi_timer_cancel);
12 EXPORT(udi_time_current);
13 EXPORT(udi_time_between);
14 EXPORT(udi_time_since);
15
16 // === CODE ===
17 void udi_timer_start(udi_timer_expired_call_t *callback, udi_cb_t *gcb, udi_time_t interval)
18 {
19         UNIMPLEMENTED();
20 }
21 void udi_timer_start_repeating(udi_timer_tick_call_t *callback, udi_cb_t *gcb, udi_time_t interval)
22 {
23         UNIMPLEMENTED();
24 }
25 void udi_timer_cancel(udi_cb_t *gcb)
26 {
27         UNIMPLEMENTED();
28 }
29
30 udi_timestamp_t udi_time_current(void)
31 {
32         return now();
33 }
34 udi_time_t udi_time_between(udi_timestamp_t start_time, udi_timestamp_t end_time)
35 {
36         udi_time_t      ret;
37         tTime   delta = end_time - start_time;
38         ret.seconds = delta / 1000;
39         ret.nanoseconds = (delta % 1000) * 1000 * 1000;
40         return ret;
41 }
42 udi_time_t udi_time_since(udi_timestamp_t start_time)
43 {
44         return udi_time_between(start_time, udi_time_current());
45 }

UCC git Repository :: git.ucc.asn.au