use std::time::{Duration, SystemTime, UNIX_EPOCH};
use super::error::ClockError;
pub(crate) fn since_epoch(time: SystemTime) -> Result<Duration, ClockError> {
time.duration_since(UNIX_EPOCH)
.map_err(|before| ClockError::new(before.duration()))
}
#[cfg(test)]
#[path = "_epoch.test.rs"]
mod tests;