diff options
| author | gingerBill <bill@gingerbill.org> | 2019-11-10 21:49:02 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-11-10 21:49:02 +0000 |
| commit | 967981aacd9ce6dd0fd5dd4925bfddb793338807 (patch) | |
| tree | c5a752d27e2acebc42c07d981aeb5d664c64d9fd /src/timings.cpp | |
| parent | 33d05a07de147e7243866207cee765110bf6d2e8 (diff) | |
Add `-show-more-timings`
Diffstat (limited to 'src/timings.cpp')
| -rw-r--r-- | src/timings.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/timings.cpp b/src/timings.cpp index 31de1ce8c..873e9493d 100644 --- a/src/timings.cpp +++ b/src/timings.cpp @@ -159,19 +159,21 @@ f64 time_stamp(TimeStamp const &ts, u64 freq, TimingUnit unit) { } void timings_print_all(Timings *t, TimingUnit unit = TimingUnit_Millisecond) { - char const SPACES[] = " "; - isize max_len; + isize const SPACES_LEN = 256; + char SPACES[SPACES_LEN+1] = {0}; + gb_memset(SPACES, ' ', SPACES_LEN); + timings__stop_current_section(t); t->total.finish = time_stamp_time_now(); - max_len = gb_min(36, t->total.label.len); + isize max_len = gb_min(36, t->total.label.len); for_array(i, t->sections) { TimeStamp ts = t->sections[i]; max_len = gb_max(max_len, ts.label.len); } - GB_ASSERT(max_len <= gb_size_of(SPACES)-1); + GB_ASSERT(max_len <= SPACES_LEN); t->total_time_seconds = time_stamp_as_s(t->total, t->freq); |