x86 32 bits build fix (#234)

This commit is contained in:
David CARLIER 2021-07-21 20:48:33 +01:00 committed by GitHub
parent 2faf1d24c8
commit 90b7ae08d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,14 @@ use crate::bolts::current_nanos;
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
#[must_use] #[must_use]
pub fn read_time_counter() -> u64 { pub fn read_time_counter() -> u64 {
unsafe { core::arch::x86_64::_rdtsc() } #[cfg(target_arch = "x86_64")]
unsafe {
core::arch::x86_64::_rdtsc()
}
#[cfg(target_arch = "x86")]
unsafe {
core::arch::x86::_rdtsc()
}
} }
/// Read a timestamp for measurements. /// Read a timestamp for measurements.