ark/time.rs
1#[cfg(not(feature = "wasm-web"))]
2pub fn timestamp_secs() -> u64 {
3 std::time::SystemTime::now()
4 .duration_since(std::time::UNIX_EPOCH)
5 .expect("time went backwards")
6 .as_secs()
7}
8
9#[cfg(feature = "wasm-web")]
10pub fn timestamp_secs() -> u64 {
11 (js_sys::Date::now() as u64) / 1_000
12}