Skip to main content

deribit_http/
time_compat.rs

1//! Cross-platform time utilities for native and WASM targets
2//!
3//! This module provides unified `Instant`, `SystemTime`, and `UNIX_EPOCH`
4//! types that work across both native (std::time) and WASM (web_time) targets.
5
6#[cfg(not(target_arch = "wasm32"))]
7pub use std::time::Instant;
8#[cfg(target_arch = "wasm32")]
9pub use web_time::Instant;
10
11#[cfg(not(target_arch = "wasm32"))]
12pub use std::time::{SystemTime, UNIX_EPOCH};
13#[cfg(target_arch = "wasm32")]
14pub use web_time::{SystemTime, UNIX_EPOCH};