mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 09:39:08 -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)
|
|
}
|