We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d69fb1 commit 533d115Copy full SHA for 533d115
1 file changed
src/time.rs
@@ -1,12 +1,11 @@
1
//! Architecture-specific timing functions, taken from
2
//! <https://github.com/spence/tach>
3
4
-use core::arch::asm;
5
-
6
/// Read from the `cntvct_el0` register on Arm `AArch64`.
7
#[cfg(target_arch = "aarch64")]
8
#[inline(always)]
9
pub fn ticks() -> u64 {
+ use core::arch::asm;
10
let cnt: u64;
11
// SAFETY: `mrs cntvct_el0` only reads the architectural virtual counter
12
// register and does not touch memory or the stack.
@@ -24,6 +23,7 @@ pub fn ticks() -> u64 {
24
23
#[cfg(target_arch = "riscv64")]
25
26
27
28
// SAFETY: `rdtime` reads a timer CSR into a general-purpose register and does not access
29
// Rust memory.
0 commit comments