Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit dad4ff5

Browse files
committed
Replace Duration::span with Instant::now().elapsed
1 parent fe2a666 commit dad4ff5

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cli/src/main.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(duration_span)]
2-
31
#[macro_use]
42
extern crate log;
53

@@ -9,7 +7,7 @@ extern crate linenoise;
97
extern crate llamadb;
108

119
use std::io::Write;
12-
use std::time::Duration;
10+
use std::time::Instant;
1311

1412
mod prettyselect;
1513
use prettyselect::pretty_select;
@@ -82,12 +80,10 @@ fn execute_statement(out: &mut Write, db: &mut llamadb::tempdb::TempDb, statemen
8280
{
8381
use llamadb::tempdb::ExecuteStatementResponse;
8482

85-
let mut execute_result = None;
83+
let now = Instant::now();
84+
let execute_result = Some(db.execute_statement(statement));
85+
let duration = now.elapsed();
8686

87-
let duration = Duration::span(|| {
88-
execute_result = Some(db.execute_statement(statement));
89-
});
90-
9187
let seconds = duration.as_secs() as f32 + (duration.subsec_nanos() as f32 * 1.0e-9);
9288

9389
let duration_string = format!("{:.3}s", seconds);

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(into_cow, associated_type_defaults)]
1+
#![feature(associated_type_defaults)]
22

33
#[macro_use]
44
extern crate log;

0 commit comments

Comments
 (0)