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 1
1
use super :: timestamp:: * ;
2
+ #[ cfg( asm) ]
3
+ use std:: llvm_asm;
2
4
3
5
pub ( crate ) struct CPUCounter ;
4
6
5
7
#[ cfg( asm) ]
6
8
#[ inline]
7
9
unsafe fn cpucounter ( ) -> u64 {
8
10
let ( low, high) : ( u64 , u64 ) ;
9
- asm ! ( "rdtscp" : "={eax}" ( low) , "={edx}" ( high) : : "ecx" ) ;
11
+ llvm_asm ! ( "rdtscp" : "={eax}" ( low) , "={edx}" ( high) : : "ecx" ) ;
10
12
( high << 32 ) | low
11
13
}
12
14
Original file line number Diff line number Diff line change 1
- #![ cfg_attr( asm, feature( asm ) ) ]
1
+ #![ cfg_attr( asm, feature( llvm_asm ) ) ]
2
2
3
3
//! Precision is a simple crate to perform measurements using hardware counters.
4
4
//!
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl Precision {
43
43
44
44
#[ cfg( any( target_os = "macos" , target_os = "freebsd" ) ) ]
45
45
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} ;
47
47
use std:: ffi:: CString ;
48
48
use std:: mem;
49
49
use std:: ptr;
You can’t perform that action at this time.
0 commit comments