mirror of
https://github.com/denoland/deno.git
synced 2024-12-11 10:07: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)
|
|
}
|