3 ms·
nushell does that out of the box: > history | get 82076 ╭─────────────────┬──────────────────╮ │ start_timestamp │ 2025-06-24 16:46 │ │ command
by MyOutfitIsVague 1y ago
nushell does that out of the box:
> history | get 82076
╭─────────────────┬──────────────────╮
│ start_timestamp │ 2025-06-24 16:46 │
│ command │ mpc play │
│ cwd │ /home/work │
│ duration │ 1ms │
│ exit_status │ 0 │
╰─────────────────┴──────────────────╯
It's really nice, because it doesn't just tell you time between command executions (or rather time between commands finishing), but the actual runtime duration of the command.
- __MatrixMan__ 1y agoI love nushell. You can also query by friendlier things than index: history | where exit_status == 127 | last | get duration 2sec 410ms The syntax ends up very clean looking since the data going through the pipes is typed, and the error messages are top notch × Types 'duration' and 'int' are not compatible for the '-' operator. ╭─[entry #47:1:2] 1 │ (history | where exit_status == 127 | last | get duration) - 10 · ───┬─── ┬ ─┬ · │ │ ╰── int · │ ╰── does not operate between 'duration' and 'int' · ╰── duration ╰──── (fingers crossed hn doesn't mangle that...)