File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ pub fn compile_codegen_unit(
108
108
109
109
// We assume that the cost to run LLVM on a CGU is proportional to
110
110
// the time we needed for codegenning it.
111
- let cost = time_to_codegen. as_secs ( ) * 1_000_000_000 + time_to_codegen . subsec_nanos ( ) as u64 ;
111
+ let cost = time_to_codegen. as_nanos ( ) as u64 ;
112
112
113
113
fn module_codegen ( tcx : TyCtxt < ' _ > , cgu_name : Symbol ) -> ModuleCodegen < ModuleLlvm > {
114
114
let cgu = tcx. codegen_unit ( cgu_name) ;
Original file line number Diff line number Diff line change @@ -98,10 +98,6 @@ fn fmt_thousands_sep(mut n: usize, sep: char) -> String {
98
98
output
99
99
}
100
100
101
- fn ns_from_dur ( dur : Duration ) -> u64 {
102
- dur. as_secs ( ) * 1_000_000_000 + ( dur. subsec_nanos ( ) as u64 )
103
- }
104
-
105
101
fn ns_iter_inner < T , F > ( inner : & mut F , k : u64 ) -> u64
106
102
where
107
103
F : FnMut ( ) -> T ,
@@ -110,7 +106,7 @@ where
110
106
for _ in 0 ..k {
111
107
black_box ( inner ( ) ) ;
112
108
}
113
- ns_from_dur ( start. elapsed ( ) )
109
+ start. elapsed ( ) . as_nanos ( ) as u64
114
110
}
115
111
116
112
pub fn iter < T , F > ( inner : & mut F ) -> stats:: Summary
You can’t perform that action at this time.
0 commit comments