MCPcopy Create free account
hub / github.com/NthTensor/Forte / ticks

Function ticks

src/time.rs:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5#[cfg(target_arch = "aarch64")]
6#[inline(always)]
7pub fn ticks() -> u64 {
8 use core::arch::asm;
9 let cnt: u64;
10 // SAFETY: `mrs cntvct_el0` only reads the architectural virtual counter
11 // register: it touches neither memory (`nomem`) nor the stack (`nostack`),
12 // and writes no condition flags (`preserves_flags`).
13 unsafe {
14 asm!(
15 "mrs {}, cntvct_el0",
16 out(reg) cnt,
17 options(nostack, nomem, preserves_flags)
18 );
19 }
20 cnt
21}
22
23/// Read from rdtime on RISC-V

Callers 1

promoteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected