MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_time_stamp

Method get_time_stamp

crates/jit-debug/src/perf_jitdump.rs:193–201  ·  view source on GitHub ↗

Returns timestamp from a single source

(&self)

Source from the content-addressed store, hash-verified

191impl JitDumpFile {
192 /// Returns timestamp from a single source
193 pub fn get_time_stamp(&self) -> u64 {
194 // We need to use `CLOCK_MONOTONIC` on Linux which is what `Instant`
195 // conveniently also uses, but `Instant` doesn't allow us to get access
196 // to nanoseconds as an internal detail, so we calculate the nanoseconds
197 // ourselves here.
198 let ts = rustix::time::clock_gettime(rustix::time::ClockId::Monotonic);
199 // TODO: What does it mean for either sec or nsec to be negative?
200 (ts.tv_sec * 1_000_000_000 + ts.tv_nsec) as u64
201 }
202
203 /// Returns the next code index
204 pub fn next_code_index(&mut self) -> u64 {

Callers 2

register_functionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected