Skip to content

Commit 01f0749

Browse files
committed
docs: clarify timings
1 parent 00e482b commit 01f0749

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
---
1111

12-
Generated with the [advent-of-code-rust](https://github.com/fspoettel/advent-of-code-rust) template.
12+
Generated from [fspoettel/advent-of-code-rust](https://github.com/fspoettel/advent-of-code-rust).
1313

1414
## Create your own
1515

16-
1. Open the [advent-of-code-rust](https://github.com/fspoettel/advent-of-code-rust) template on Github.
16+
1. Open ☝️ template on Github.
1717
2. Click `Use this template` and create your repository.
1818
3. Clone the repository to your machine.
1919

@@ -41,6 +41,8 @@ Generated with the [advent-of-code-rust](https://github.com/fspoettel/advent-of-
4141
# 🎄 Type `cargo run --bin 01` to run your solution.
4242
```
4343

44+
Individual solutions live in the `./src/bin` directory as separate binaries.
45+
4446
Every [solution](https://git.io/JyXa8) has _unit tests_ referencing the _example_ file. Use these tests to develop and debug your solution. When editing a solution, `rust-analyzer` will display buttons for these actions above the unit tests.
4547

4648
### Download inputs for a day
@@ -81,6 +83,8 @@ cargo run --bin <day>
8183

8284
To run an optimized version for benchmarking, use the `--release` flag or the alias `cargo rr --bin <day>`.
8385

86+
Displayed _timings_ show the raw execution time of your solution w/o overhead (e.g. file reads).
87+
8488
### Run solutions for all days
8589

8690
```sh
@@ -104,6 +108,8 @@ cargo run
104108

105109
To run an optimized version for benchmarking, use the `--release` flag or the alias `cargo rr`.
106110

111+
_Total timing_ is computed from individual solution _timings_ and excludes overhead.
112+
107113
### Run all solutions against example input
108114

109115
```sh

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ macro_rules! solve {
1515
fn print_result<T: Display>(func: impl FnOnce(&str) -> T, input: &str) {
1616
let timer = Instant::now();
1717
let result = func(input);
18-
let time = timer.elapsed();
18+
let elapsed = timer.elapsed();
1919
println!(
2020
"{} {}(elapsed: {:.2?}){}",
21-
result, ANSI_ITALIC, time, ANSI_RESET
21+
result, ANSI_ITALIC, elapsed, ANSI_RESET
2222
);
2323
}
2424

0 commit comments

Comments
 (0)