Skip to content

Commit

Permalink
Add timing
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Dec 21, 2023
1 parent 21f531a commit dff1856
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/from_stdin.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
use std::io;
use std::time::Instant;

use mzdata::MzMLReader;
use mzdata::io::PreBufferedStream;



fn main() -> io::Result<()> {
let start = Instant::now();
let stream = io::stdin();
let stream = PreBufferedStream::new(stream)?;

let reader = MzMLReader::new(stream);
let spectra: Vec<_> = reader.collect();
eprintln!("Read {} spectra", spectra.len());
let end = Instant::now();
eprintln!("Read {} spectra in {:0.3?}", spectra.len(), end - start);
assert!(spectra.len() > 0);

Ok(())
}

0 comments on commit dff1856

Please sign in to comment.