def Duration.to_ms
import bend-kit-time@0.3.0.0/time.bend as Timeimport Base
import bend-kit-int@0.2.0.0/int.bend as Int
47# Whole milliseconds, rounded down.
48def Duration.to_ms(d: Duration) -> Int.I64:
49 match d:
50 case Duration{s, n}:
51 Int.I64.add(Int.I64.mul(s, i64(1000)), i64((n / 1000000 : U32)))