Skip to content

Commit a46e59b

Browse files
committed
Remove time dependency & try bump libc
I'm not on a system capable of testing, but currently our own dependency causes cargo to pull down both libc 0.1 & 0.2. We should update to libc 0.2 to combine dependencies. time is deprecated in favor of std::time
1 parent 895e4e5 commit a46e59b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ exclude = [
1515
]
1616

1717
[dependencies]
18-
libc = "0.1.10"
18+
libc = "0.2"
1919
num = "0.1.27"
20-
time = "0.1.32"
2120
lazy_static = "0.2.1"
2221

2322
[build-dependencies]

examples/pi.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#[macro_use(mem_info)]
22
extern crate arrayfire as af;
3-
extern crate time;
43

5-
use time::PreciseTime;
4+
use std::time::Instant;
65
use af::*;
76

87
#[allow(unused_must_use)]
@@ -16,7 +15,7 @@ fn main() {
1615
let x = &randu::<f32>(dims);
1716
let y = &randu::<f32>(dims);
1817

19-
let start = PreciseTime::now();
18+
let start = Instant::now();
2019

2120
mem_info!("Before benchmark");
2221

@@ -30,9 +29,7 @@ fn main() {
3029
let pi_val = real*4.0/(samples as f64);
3130
}
3231

33-
let end = PreciseTime::now();
34-
35-
println!("Estimated Pi Value in {} seconds", start.to(end) / 100);
32+
println!("Estimated Pi Value in {:?}", start.elapsed());
3633

3734
mem_info!("After benchmark");
3835
}

0 commit comments

Comments
 (0)