Commit 10b4f9f
committed
perf(oxfmt): make time measurement conditional (#16634)
## Summary
- Make time measurement conditional based on output mode to reduce unnecessary overhead
- `Instant::now()` is only called when using `--check` mode
- Elapsed time calculation moved to only when it's actually displayed
## Test plan
- [ ] Verify timing information still appears correctly in `--check` mode
- [ ] Confirm no timing overhead in `--write` mode
- [ ] Confirm no timing overhead in `--list-different` mode
- [ ] Run `cargo check -p oxfmt` passes
- [ ] Run `just fmt` completes successfully
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 02f59ba commit 10b4f9f
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| |||
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
95 | | - | |
96 | 93 | | |
97 | 94 | | |
| 95 | + | |
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
| |||
0 commit comments