use ordered_float::NotNan;
use crate::Pid;
use heim_common::units::{time, Time};
#[derive(Debug, Hash, PartialEq, Eq, Clone)]
pub struct UniqueId {
pid: Pid,
create_time: NotNan<f64>,
}
impl UniqueId {
pub fn new(pid: Pid, create_time: Time) -> UniqueId {
let seconds = create_time.get::<time::second>();
let time = NotNan::new(seconds).expect("Process create time can't be NaN");
UniqueId {
pid,
create_time: time,
}
}
pub fn create_time(&self) -> Time {
Time::new::<time::second>(*self.create_time)
}
}