ltk/
time.rs

1
2
3
4
5
6
7
8
9
// SPDX-License-Identifier: LGPL-2.1-only
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>

//! The monotonic clock, which `std` does not provide in a browser: [`Instant`] is `std`'s natively and `web_time`'s on wasm32, where `std::time::Instant::now` panics. An app that builds for both uses it in place of `std`'s.

#[ cfg( not( target_arch = "wasm32" ) ) ]
pub use std::time::Instant;
#[ cfg( target_arch = "wasm32" ) ]
pub use web_time::Instant;