@@ -170,7 +170,7 @@ runner.
170
170
171
171
The type signature of a benchmark function differs from a unit test:
172
172
it takes a mutable reference to type
173
- ` extra:: test::BenchHarness` . Inside the benchmark function, any
173
+ ` test::BenchHarness ` . Inside the benchmark function, any
174
174
time-variable or "setup" code should execute first, followed by a call
175
175
to ` iter ` on the benchmark harness, passing a closure that contains
176
176
the portion of the benchmark you wish to actually measure the
@@ -185,9 +185,10 @@ amount.
185
185
For example:
186
186
187
187
~~~
188
- extern crate extra;
188
+ extern crate test;
189
+
189
190
use std::vec;
190
- use extra:: test::BenchHarness;
191
+ use test::BenchHarness;
191
192
192
193
#[bench]
193
194
fn bench_sum_1024_ints(b: &mut BenchHarness) {
@@ -243,8 +244,8 @@ recognize that some calculation has no external effects and remove
243
244
it entirely.
244
245
245
246
~~~
246
- extern crate extra ;
247
- use extra:: test::BenchHarness;
247
+ extern crate test ;
248
+ use test::BenchHarness;
248
249
249
250
#[bench]
250
251
fn bench_xor_1000_ints(bh: &mut BenchHarness) {
@@ -273,15 +274,15 @@ example above by adjusting the `bh.iter` call to
273
274
bh.iter(|| range(0, 1000).fold(0, |old, new| old ^ new))
274
275
~~~
275
276
276
- Or, the other option is to call the generic ` extra:: test::black_box`
277
+ Or, the other option is to call the generic ` test::black_box `
277
278
function, which is an opaque "black box" to the optimizer and so
278
279
forces it to consider any argument as used.
279
280
280
281
~~~
281
- use extra:: test::black_box
282
+ extern crate test;
282
283
283
284
bh.iter(|| {
284
- black_box(range(0, 1000).fold(0, |old, new| old ^ new));
285
+ test:: black_box(range(0, 1000).fold(0, |old, new| old ^ new));
285
286
});
286
287
~~~
287
288
0 commit comments