def Duration.to_ms_nat
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
60# Whole milliseconds, rounded down; 0 when d is negative.
61def Duration.to_ms_nat(d: Duration) -> Nat:
62 match d:
63 case Duration{s, n}:
64 Duration.to_nat.of(Int.I64.to_nat(s), 1000n, (n / 1000000 : U32))