diff options
| author | bors <bors@rust-lang.org> | 2014-05-16 16:31:24 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-16 16:31:24 -0700 |
| commit | 2216eceea51b344560f4791336b3ea2c897eec39 (patch) | |
| tree | 231d3f6640253dc2371426efe5ea67ff53b8d226 /src/rustllvm/PassWrapper.cpp | |
| parent | cea4803d4cf56ded65be6a9e043a6219c661c572 (diff) | |
| parent | 8ef3e227198f6ff674b1626d0862c4112358c1a1 (diff) | |
| download | rust-2216eceea51b344560f4791336b3ea2c897eec39.tar.gz rust-2216eceea51b344560f4791336b3ea2c897eec39.zip | |
auto merge of #14216 : kballard/rust/macos_precise_time_ns, r=alexcrichton
Use sync::one::Once to fetch the mach_timebase_info only once when running precise_time_ns(). This helps because mach_timebase_info() is surprisingly inefficient. Also fix the order of operations when applying the timebase to the mach absolute time value. This improves the time on my machine from ``` test tests::bench_precise_time_ns ... bench: 157 ns/iter (+/- 4) ``` to ``` test tests::bench_precise_time_ns ... bench: 38 ns/iter (+/- 3) ``` and it will get even faster once #14174 lands.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
