mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
5 lines
179 B
Rust
5 lines
179 B
Rust
fn op_bench_now(state: &mut OpState) -> Result<u64, AnyError> {
|
|
let ns = state.borrow::<time::Instant>().elapsed().as_nanos();
|
|
let ns_u64 = u64::try_from(ns)?;
|
|
Ok(ns_u64)
|
|
}
|