Skip to content

Commit 0851770

Browse files
committed
cleanup
1 parent 0eea018 commit 0851770

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

week12/rowlab/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rowlab"
33
version = "0.1.0"
44
edition = "2024"
5+
default-run = "rowlab"
56

67
[dependencies]
78
anyhow = "1.0.97"

week12/rowlab/src/bin/measurements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const STATIONS_FILE: &str = "src/bin/stations.txt";
2424
const STATIONS_PATTERN: &str = r#"new WeatherStation\("([^*]+)", ([^)]+)\)"#;
2525

2626
/// The number of rows in the output measurements file.
27-
const MEASUREMENTS: usize = 10000;
27+
const MEASUREMENTS: usize = 1_000_000_000;
2828

2929
/// The template for the progress bar.
3030
const PROGRESS_TEMPLATE: &str =

week12/rowlab/src/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
use rowlab::aggregate;
2+
use std::time::Instant;
23

34
/// The output file to write the measurements into.
45
const MEASUREMENTS_FILE: &str = "../measurements.txt";
56

67
fn main() {
8+
let start = Instant::now();
9+
710
let res = aggregate(MEASUREMENTS_FILE);
8-
println!("{}", res.into_string())
11+
println!("{}", res.into_string());
12+
13+
let elapsed = start.elapsed();
14+
println!("Elapsed time: {:?}", elapsed);
915
}

week12/rowlab_ref/src/bin/measurements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const STATIONS_FILE: &str = "src/bin/stations.txt";
2424
const STATIONS_PATTERN: &str = r#"new WeatherStation\("([^*]+)", ([^)]+)\)"#;
2525

2626
/// The number of rows in the output measurements file.
27-
const MEASUREMENTS: usize = 10000;
27+
const MEASUREMENTS: usize = 1_000_000_000;
2828

2929
/// The template for the progress bar.
3030
const PROGRESS_TEMPLATE: &str =

week12/rowlab_ref/src/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
use rowlab_ref::aggregate;
2+
use std::time::Instant;
23

34
/// The output file to write the measurements into.
45
const MEASUREMENTS_FILE: &str = "../measurements.txt";
56

67
fn main() {
8+
let start = Instant::now();
9+
710
let res = aggregate(MEASUREMENTS_FILE);
8-
println!("{}", res.into_string())
11+
println!("{}", res.into_string());
12+
13+
let elapsed = start.elapsed();
14+
println!("Elapsed time: {:?}", elapsed);
915
}

0 commit comments

Comments
 (0)