File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
branches/snap-stage3/src/libstd/num Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: d9776236c8991af312113741e74c20e2070f252f
4
+ refs/heads/snap-stage3: 9f7e364d3a0f5d325f3722efb9c7ae4257b04e3d
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -703,3 +703,27 @@ mod test {
703
703
assert_eq ! ( n, None ) ;
704
704
}
705
705
}
706
+
707
+ #[ cfg( test) ]
708
+ mod bench {
709
+ use extra:: test:: BenchHarness ;
710
+ use rand:: { XorShiftRng , RngUtil } ;
711
+ use uint;
712
+ use float;
713
+
714
+ #[ bench]
715
+ fn uint_to_str_rand ( bh : & mut BenchHarness ) {
716
+ let mut rng = XorShiftRng :: new ( ) ;
717
+ do bh. iter {
718
+ uint:: to_str ( rng. gen ( ) ) ;
719
+ }
720
+ }
721
+
722
+ #[ bench]
723
+ fn float_to_str_rand ( bh : & mut BenchHarness ) {
724
+ let mut rng = XorShiftRng :: new ( ) ;
725
+ do bh. iter {
726
+ float:: to_str ( rng. gen ( ) ) ;
727
+ }
728
+ }
729
+ }
You can’t perform that action at this time.
0 commit comments