1
Fork 0

time: Deprecate the library in the distribution

This commit deprecates the entire libtime library in favor of the
externally-provided libtime in the rust-lang organization. Users of the
`libtime` crate as-is today should add this to their Cargo manifests:

    [dependencies.time]
    git = "https://github.com/rust-lang/time"

To implement this transition, a new function `Duration::span` was added to the
`std::time::Duration` time. This function takes a closure and then returns the
duration of time it took that closure to execute. This interface will likely
improve with `FnOnce` unboxed closures as moving in and out will be a little
easier.

Due to the deprecation of the in-tree crate, this is a:

[breaking-change]

cc #18855, some of the conversions in the `src/test/bench` area may have been a
little nicer with that implemented
This commit is contained in:
Alex Crichton 2014-11-10 12:27:56 -08:00
parent e4ead7b034
commit fcd05ed99f
22 changed files with 329 additions and 266 deletions

View file

@ -25,7 +25,6 @@ extern crate rustc;
extern crate serialize;
extern crate syntax;
extern crate "test" as testing;
extern crate time;
#[phase(plugin, link)] extern crate log;
use std::io;
@ -238,7 +237,6 @@ pub fn main_args(args: &[String]) -> int {
};
info!("going to format");
let started = time::precise_time_ns();
match matches.opt_str("w").as_ref().map(|s| s.as_slice()) {
Some("html") | None => {
match html::render::run(krate, &external_html, output.unwrap_or(Path::new("doc"))) {
@ -257,8 +255,6 @@ pub fn main_args(args: &[String]) -> int {
return 1;
}
}
let ended = time::precise_time_ns();
info!("Took {:.03f}s", (ended as f64 - started as f64) / 1e9f64);
return 0;
}