diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2024-04-08 12:50:42 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2024-04-08 12:50:42 +0200 |
commit | 0b0d50c50ebf4ea120440d2eb7d91dda11628898 (patch) | |
tree | 68d6b2fc2e2e710d164dd84ec376a7bfd76c0c21 | |
parent | 599233ffdf1783011276145bd6933a1fd46fd932 (diff) |
Row_printNanoseconds fixes
Don't print twice for 0.9s.
Don't truncate on 1.2s, leading to an abort.
-rw-r--r-- | Row.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -425,13 +425,14 @@ void Row_printNanoseconds(RichString* str, unsigned long long totalNanoseconds, if (totalMicroseconds < 1000000) { len = xSnprintf(buffer, sizeof(buffer), ".%06lus ", (unsigned long)totalMicroseconds); RichString_appendnAscii(str, baseColor, buffer, len); + return; } unsigned long long totalSeconds = totalMicroseconds / 1000000; unsigned long microseconds = totalMicroseconds % 1000000; if (totalSeconds < 60) { int width = 5; - unsigned long fraction = microseconds; + unsigned long fraction = microseconds / 10; if (totalSeconds >= 10) { width--; fraction /= 10; |