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
38
39
40
41
42
43
//! Shared stderr progress/timing log.
//!
//! This lives in the foundation crate so every component — CLI stages and the
//! sub-commands plugins shell out to (`git`, `cargo metadata`, `rustc`) — emits
//! one consistent line format. All output goes to **stderr** (machine output and
//! artifacts go to stdout/files), prefixed with a local `HH:MM:SS.mmm` stamp.
//! Durations are printed to **millisecond precision** (`0.231s`).
use Local;
use ;
/// Local wall-clock stamp, `HH:MM:SS.mmm`.
/// Format a duration as seconds with millisecond precision, e.g. `0.231s`,
/// `29.900s`. The single authority for how timings render across the tool.
/// Emit one stamped line to stderr: `[HH:MM:SS.mmm] <msg>`.
/// Log a completed internal sub-command (an external tool code-ranker shelled out
/// to) with its duration: `[HH:MM:SS.mmm] ↳ <label> — 0.231s`. The `↳` marks it
/// as a nested step under the current stage.
/// Time `f`, log it as a sub-command (see [`subcmd`]), and return its value.
/// Wrap every `git` / `cargo` / `rustc` invocation in this so the cost of each
/// external call is visible — these dominate the wall clock on a cold cache.