File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11use super :: timestamp:: * ;
2+ #[ cfg( asm) ]
3+ use std:: llvm_asm;
24
35pub ( crate ) struct CPUCounter ;
46
57#[ cfg( asm) ]
68#[ inline]
79unsafe fn cpucounter ( ) -> u64 {
810 let ( low, high) : ( u64 , u64 ) ;
9- asm ! ( "rdtscp" : "={eax}" ( low) , "={edx}" ( high) : : "ecx" ) ;
11+ llvm_asm ! ( "rdtscp" : "={eax}" ( low) , "={edx}" ( high) : : "ecx" ) ;
1012 ( high << 32 ) | low
1113}
1214
Original file line number Diff line number Diff line change 1- #![ cfg_attr( asm, feature( asm ) ) ]
1+ #![ cfg_attr( asm, feature( llvm_asm ) ) ]
22
33//! Precision is a simple crate to perform measurements using hardware counters.
44//!
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl Precision {
4343
4444 #[ cfg( any( target_os = "macos" , target_os = "freebsd" ) ) ]
4545 fn guess_frequency_using_sysctl ( name : & str ) -> Result < u64 , & ' static str > {
46- use libc:: { self , c_long, size_t} ;
46+ use libc:: { c_long, size_t} ;
4747 use std:: ffi:: CString ;
4848 use std:: mem;
4949 use std:: ptr;
You can’t perform that action at this time.
0 commit comments