use std::path::{Path, PathBuf};
#[macro_use]
pub mod macros;
pub mod log;
pub(crate) mod records;
pub(crate) mod util;
pub mod error;
#[cfg(test)]
mod test;
type WpiTimestamp = u64;
type EntryId = u32;
type EntryName = String;
type EntryType = String;
type EntryMetadata = String;
type LeBytes = Vec<u8>;
type LeByte = u8;
type EntryTypeMap = std::collections::HashMap<EntryId, EntryType>;
type EntryIdToNameMap = bimap::BiMap::<EntryId, EntryName>;
pub fn sec_from_micros(micros: WpiTimestamp) -> f64 {
micros as f64 / 1_000_000.0
}
pub fn now() -> WpiTimestamp {
let now = std::time::SystemTime::now();
let duration = now.duration_since(std::time::UNIX_EPOCH).unwrap();
duration.as_micros() as WpiTimestamp
}
pub fn absolute_path(rel_path: &Path) -> PathBuf {
let cwd = std::env::current_dir().unwrap();
cwd.join(rel_path)
}