summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-11 03:47:16 +0000
committerbors <bors@rust-lang.org>2015-08-11 03:47:16 +0000
commit50141d7e1e5b1b539d45240dff709fa68e7472c2 (patch)
treeafd3b867660ee71b379e1d6dbcc5d8bab2170397 /src/test
parent8b3705528ab6a7511928d46c654cc0040272f48d (diff)
parentb51e0090696c82c6156bbfcd0e67ac68df67379b (diff)
downloadrust-50141d7e1e5b1b539d45240dff709fa68e7472c2.tar.gz
rust-50141d7e1e5b1b539d45240dff709fa68e7472c2.zip
Auto merge of #26818 - sfackler:duration-stabilization, r=aturon
This commit stabilizes the `std::time` module and the `Duration` type.
`Duration::span` remains unstable, and the `Display` implementation for
`Duration` has been removed as it is still being reworked and all trait
implementations for stable types are de facto stable.

This is a [breaking-change] to those using `Duration`'s `Display`
implementation.

I'm opening this PR as a platform for discussion - there may be some method renaming to do as part of the stabilization process.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/core-map.rs2
-rw-r--r--src/test/bench/core-set.rs2
-rw-r--r--src/test/bench/core-std.rs2
-rw-r--r--src/test/bench/msgsend-pipes-shared.rs4
-rw-r--r--src/test/bench/msgsend-pipes.rs4
-rw-r--r--src/test/bench/msgsend-ring-mutex-arcs.rs4
-rw-r--r--src/test/bench/shootout-pfib.rs2
-rw-r--r--src/test/bench/std-smallintmap.rs8
-rw-r--r--src/test/bench/task-perf-alloc-unwind.rs2
9 files changed, 15 insertions, 15 deletions
diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs
index af61b0aa0cd..ebb8036bacf 100644
--- a/src/test/bench/core-map.rs
+++ b/src/test/bench/core-map.rs
@@ -16,7 +16,7 @@ use std::__rand::{Rng, thread_rng};
 use std::time::Duration;
 
 fn timed<F>(label: &str, f: F) where F: FnMut() {
-    println!("  {}: {}", label, Duration::span(f));
+    println!("  {}: {:?}", label, Duration::span(f));
 }
 
 trait MutableMap {
diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs
index d2537e09901..f4ee020d6e7 100644
--- a/src/test/bench/core-set.rs
+++ b/src/test/bench/core-set.rs
@@ -153,7 +153,7 @@ fn write_header(header: &str) {
 }
 
 fn write_row(label: &str, value: Duration) {
-    println!("{:30} {} s\n", label, value);
+    println!("{:30} {:?} s\n", label, value);
 }
 
 fn write_results(label: &str, results: &Results) {
diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs
index e7d64dfe2c5..26fb3630487 100644
--- a/src/test/bench/core-std.rs
+++ b/src/test/bench/core-std.rs
@@ -51,7 +51,7 @@ fn maybe_run_test<F>(argv: &[String], name: String, test: F) where F: FnOnce() {
 
     let dur = Duration::span(test);
 
-    println!("{}:\t\t{}", name, dur);
+    println!("{}:\t\t{:?}", name, dur);
 }
 
 fn shift_push() {
diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs
index 2b7e204423e..b210f5ac26a 100644
--- a/src/test/bench/msgsend-pipes-shared.rs
+++ b/src/test/bench/msgsend-pipes-shared.rs
@@ -88,8 +88,8 @@ fn run(args: &[String]) {
     });
     let result = result.unwrap();
     print!("Count is {}\n", result);
-    print!("Test took {}\n", dur);
-    let thruput = ((size / workers * workers) as f64) / (dur.secs() as f64);
+    print!("Test took {:?}\n", dur);
+    let thruput = ((size / workers * workers) as f64) / (dur.as_secs() as f64);
     print!("Throughput={} per sec\n", thruput);
     assert_eq!(result, num_bytes * size);
 }
diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs
index 5a541420d2a..056905f1ef6 100644
--- a/src/test/bench/msgsend-pipes.rs
+++ b/src/test/bench/msgsend-pipes.rs
@@ -95,8 +95,8 @@ fn run(args: &[String]) {
     });
     let result = result.unwrap();
     print!("Count is {}\n", result);
-    print!("Test took {}\n", dur);
-    let thruput = ((size / workers * workers) as f64) / (dur.secs() as f64);
+    print!("Test took {:?}\n", dur);
+    let thruput = ((size / workers * workers) as f64) / (dur.as_secs() as f64);
     print!("Throughput={} per sec\n", thruput);
     assert_eq!(result, num_bytes * size);
 }
diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs
index 24ecaf4b024..b7f9dc94a0b 100644
--- a/src/test/bench/msgsend-ring-mutex-arcs.rs
+++ b/src/test/bench/msgsend-ring-mutex-arcs.rs
@@ -107,9 +107,9 @@ fn main() {
 
     // all done, report stats.
     let num_msgs = num_tasks * msg_per_task;
-    let rate = (num_msgs as f64) / (dur.secs() as f64);
+    let rate = (num_msgs as f64) / (dur.as_secs() as f64);
 
-    println!("Sent {} messages in {}", num_msgs, dur);
+    println!("Sent {} messages in {:?}", num_msgs, dur);
     println!("  {} messages / second", rate);
     println!("  {} μs / message", 1000000. / rate);
 }
diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs
index 2d5aae30ae8..b7553dc7c70 100644
--- a/src/test/bench/shootout-pfib.rs
+++ b/src/test/bench/shootout-pfib.rs
@@ -114,7 +114,7 @@ fn main() {
                 let dur = Duration::span(|| fibn = Some(fib(n)));
                 let fibn = fibn.unwrap();
 
-                println!("{}\t{}\t{}", n, fibn, dur);
+                println!("{}\t{}\t{:?}", n, fibn, dur);
             }
         }
     }
diff --git a/src/test/bench/std-smallintmap.rs b/src/test/bench/std-smallintmap.rs
index 6a39a6db0c7..64f2381d1c3 100644
--- a/src/test/bench/std-smallintmap.rs
+++ b/src/test/bench/std-smallintmap.rs
@@ -54,8 +54,8 @@ fn main() {
 
     let maxf = max as f64;
 
-    println!("insert(): {} seconds\n", checkf);
-    println!("        : {} op/s\n", maxf / checkf.secs() as f64);
-    println!("get()   : {} seconds\n", appendf);
-    println!("        : {} op/s\n", maxf / appendf.secs() as f64);
+    println!("insert(): {:?} seconds\n", checkf);
+    println!("        : {} op/s\n", maxf / checkf.as_secs() as f64);
+    println!("get()   : {:?} seconds\n", appendf);
+    println!("        : {} op/s\n", maxf / appendf.as_secs() as f64);
 }
diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs
index 3bd7b781251..5f34d0f6301 100644
--- a/src/test/bench/task-perf-alloc-unwind.rs
+++ b/src/test/bench/task-perf-alloc-unwind.rs
@@ -36,7 +36,7 @@ fn run(repeat: isize, depth: isize) {
                 recurse_or_panic(depth, None)
             }).join();
         });
-        println!("iter: {}", dur);
+        println!("iter: {:?}", dur);
     }
 }