Skip to content

Commit 3ebce9a

Browse files
committed
Display the time spent on the conversion, just to show off
1 parent 15e3094 commit 3ebce9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extern crate yaml_rust;
44
use std::io::Read;
55
use std::fs::File;
66
use std::env;
7+
use std::time::Instant;
78
use quick_xml::Reader;
89
use quick_xml::events::Event;
910
use yaml_rust::YamlLoader;
@@ -86,6 +87,7 @@ fn main() {
8687
let mut gmldims: u8 = 2;
8788
let mut gmlpos = false;
8889
let mut ewkb: Vec<u8> = Vec::new();
90+
let start = Instant::now();
8991
loop {
9092
match reader.read_event(&mut buf) {
9193
Ok(Event::Start(ref e)) => {
@@ -249,5 +251,5 @@ fn main() {
249251
}
250252
buf.clear();
251253
}
252-
eprintln!("{} rows processed", count);
254+
eprintln!("{} rows processed in {} seconds", count, start.elapsed().as_secs());
253255
}

0 commit comments

Comments
 (0)