rustmatica 0.5.2

A Rust library for reading, editing, and writing Minecraft litematic files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "chrono")]
pub(crate) fn current_time() -> chrono::DateTime<chrono::Utc> {
    chrono::Utc::now()
}

#[cfg(all(not(target_family = "wasm"), not(feature = "chrono")))]
pub(crate) fn current_time() -> i64 {
    std::time::SystemTime::now()
        .duration_since(std::time::SystemTime::UNIX_EPOCH)
        .unwrap()
        .as_millis() as i64
}

#[cfg(all(target_family = "wasm", not(feature = "chrono")))]
pub(crate) fn current_time() -> i64 {
    js_sys::Date::now() as i64
}