Skip to content

Commit 2f3ceec

Browse files
committed
Use std::time instead of deprecated crate time
1 parent 6afdb4e commit 2f3ceec

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ heap_size = ["heapsize", "heapsize_plugin"]
3636
codegen = ["html5ever_macros"]
3737

3838
[dependencies]
39-
time = "0"
4039
log = "0"
4140
phf = "0.7"
4241
string_cache = "0.2.0"

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ extern crate mac;
2929

3030
extern crate phf;
3131

32-
extern crate time;
33-
3432
pub use tokenizer::Attribute;
3533
pub use driver::{ParseOpts, parse_document, parse_fragment, Parser};
3634

src/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ macro_rules! unwrap_or_return {
2424

2525
macro_rules! time {
2626
($e:expr) => {{
27-
let t0 = ::time::precise_time_ns();
27+
let now = ::std::time::Instant::now();
2828
let result = $e;
29-
let dt = ::time::precise_time_ns() - t0;
29+
let dt = now.elapsed().as_secs() as u64;
3030
(result, dt)
3131
}}
3232
}

0 commit comments

Comments
 (0)