Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Aug 22, 2024
1 parent 3212b34 commit 1375da0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions chronicles/log_output.nim
Original file line number Diff line number Diff line change
Expand Up @@ -437,21 +437,21 @@ proc getSecondsPart(timestamp: Time): string =
msec = timestamp.nanosecond() div 1_000_000

if sec > 0 and sec <= 9:
let tmp = $sec
res[1] = tmp[0]
res[1] = '0' + char(sec)
elif sec >= 10:
let tmp = $sec
res[0] = tmp[0]; res[1] = tmp[1]
res[0] = '0' + char(sec div 10)
res[1] = '0' + char(sec mod 10)

if msec > 0 and msec <= 9:
let tmp = $msec
res[5] = tmp[0]
res[5] = '0' + char(msec)
elif msec >= 10 and msec <= 99:
let tmp = $msec
res[4] = tmp[0]; res[5] = tmp[1]
res[4] = '0' + char(msec div 10)
res[5] = '0' + char(msec mod 10)
elif msec >= 100:
let tmp = $msec
res[3] = tmp[0]; res[4] = tmp[1]; res[5] = tmp[2]
let tmp = msec mod 100
res[3] = '0' + char(msec div 100)
res[4] = '0' + char(tmp div 10)
res[5] = '0' + char(tmp mod 10)
res

proc getFastDateTimeString(): string =
Expand Down

0 comments on commit 1375da0

Please sign in to comment.