Returns timestamp from a single source
(&self)
| 191 | impl 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 { |
no outgoing calls
no test coverage detected