corp-finance-core 1.1.0

Institutional-grade corporate finance calculations with 128-bit decimal precision — DCF, WACC, comps, LBO, credit metrics, derivatives, fixed income, options, and 60+ specialty modules. No f64 in financials. WASM-compatible.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Cross-platform compatibility shims.
//!
//! `std::time::Instant::now()` panics on `wasm32-unknown-unknown` (compiles to
//! `unreachable`). `web-time` provides a drop-in replacement that delegates to
//! `performance.now()` in browsers and to the JS host's clock in Node.
//!
//! All modules use `crate::compat::Instant` instead of `std::time::Instant` so
//! the same source compiles cleanly for native, NAPI, and WASM targets.

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

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