xref: /DragonOS/kernel/src/time/mod.rs (revision bacd691c9ef0502b5cc618aad50517f9e59df5e0)
1 pub mod sleep;
2 pub mod timekeep;
3 pub mod timer;
4 
5 /// 表示时间的结构体
6 #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
7 pub struct TimeSpec {
8     pub tv_sec: i64,
9     pub tv_nsec: i64,
10 }
11 
12 impl TimeSpec {
13     pub fn new(sec: i64, nsec: i64) -> TimeSpec {
14         return TimeSpec {
15             tv_sec: sec,
16             tv_nsec: nsec,
17         };
18     }
19 }
20