Esc

Signed_Duration

structextensionsince 0.36.1Source
  • macOS: Signed_Duration works on macOS
  • Linux: Signed_Duration works on Linux
  • Windows: Signed_Duration works on Windows
  • Wasm: Signed_Duration works on Wasm

Declaration

Signed_Duration :: struct {
    seconds: s64;    nanoseconds: s32;}

Exact elapsed time, with the same remainder invariant as Timestamp.

Example↗
d, error := signed_duration(1, 5);
assert(error.kind == .NONE && d.seconds == 1 && d.nanoseconds == 5);

See also