it: test window gains kb focus when mapped
This commit is contained in:
parent
cbf539cbcc
commit
c827a93dbb
19 changed files with 672 additions and 39 deletions
14
src/time.rs
14
src/time.rs
|
|
@ -36,6 +36,13 @@ impl Time {
|
|||
Ok(Self(time))
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn now_unchecked() -> Time {
|
||||
let mut time = uapi::pod_zeroed();
|
||||
let _ = uapi::clock_gettime(c::CLOCK_MONOTONIC, &mut time);
|
||||
Self(time)
|
||||
}
|
||||
|
||||
pub fn round_to_ms(self) -> Time {
|
||||
if self.0.tv_nsec > 999_000_000 {
|
||||
Time(c::timespec {
|
||||
|
|
@ -49,6 +56,13 @@ impl Time {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn usec(self) -> u64 {
|
||||
let sec = self.0.tv_sec as u64 * 1_000_000;
|
||||
let nsec = self.0.tv_nsec as u64 / 1_000;
|
||||
sec + nsec
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Time {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue