Skip to content

Commit 36f68f7

Browse files
committed
Left-pad CLI timing
1 parent 8618830 commit 36f68f7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ Running the executable shows a pretty-printed output for the respective command
9696
#<Token type=TOKEN_EOF value='' range=[12, 12] start=2:1 end=2:1>
9797
9898
Finished lexing in:
99-
- 26.000 µs
100-
- 0.026000 ms
101-
- 0.000026000 s
99+
100+
24 µs
101+
0.024 ms
102+
0.000024 s
102103
```
103104

104105
### Test

src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ void print_time_diff(struct timespec start, struct timespec end, char* verb) {
2222

2323
printf("Finished");
2424
printf(" %s ", verb);
25-
printf("in:\n");
25+
printf("in:\n\n");
2626

27-
printf(" - %.3f µs\n", us);
28-
printf(" - %.6f ms\n", ms);
29-
printf(" - %.9f s\n", s);
27+
printf(" %8.0f µs\n", us);
28+
printf(" %8.3f ms\n", ms);
29+
printf(" %8.6f s\n\n", s);
3030
}
3131

3232
int main(int argc, char* argv[]) {

0 commit comments

Comments
 (0)