Skip to content

Commit

Permalink
Merge pull request #955 from quag/fix-duration-clock
Browse files Browse the repository at this point in the history
Fix panic in Chrono.duration.toText
  • Loading branch information
JonasWanke authored Feb 26, 2024
2 parents 4481c4e + 328f34d commit e54c5be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/Chrono/duration.candy
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@ toText duration :=
mm = duration | minutes | toDebugText | text.padStart 2 "0"
ss = duration | seconds | toDebugText | text.padStart 2 "0"
f = duration | subSecondComponent | tag.getValue | fixedDecimal.toText
f = f | text.getRange 0 (f | text.firstIndexOf ".") | text.padEnd 9 "0"
dot = text.firstIndexOf f "." %
FoundAt index -> index
NotFound -> 0
f = text.getRange f 0 dot
f = text.padEnd f 9 "0"
"{sign}{d}:{hh}:{mm}:{ss}.{f}"

1 comment on commit e54c5be

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on e54c5be Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: e54c5be Previous: 4481c4e Ratio
Time: Compiler/hello_world 55911448 ns/iter (± 1303821) 56570868 ns/iter (± 2972201) 0.99
Time: Compiler/fibonacci 254106396 ns/iter (± 1456728) 252458882 ns/iter (± 1414628) 1.01
Time: VM Runtime/hello_world 38192 ns/iter (± 45200) 39188 ns/iter (± 4143) 0.97
Time: VM Runtime/fibonacci/15 21506045 ns/iter (± 237175) 21591938 ns/iter (± 147364) 1.00
Time: VM Runtime/PLB/binarytrees/6 603733820 ns/iter (± 2654754) 601780800 ns/iter (± 3370269) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.