1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! The minimal set of utils for writing [Advent of Code](https://adventofcode.com/) solutions.
pub use AocCommand;
pub use BufferedInput;
use Display;
use Instant;
/// Runs the code, and prints out the elapsed time and the result.
///
/// First prints the elapsed time to stderr,
/// then the result to stdout, in separate lines.
///
/// # Example
///
/// ```
/// use aoc_utils::measure_and_print;
///
/// measure_and_print(|| {
/// (0..10_000).sum::<u64>()
/// });
///
/// // Prints:
/// // 227.81 μs
/// // 49995000
/// ```