Language / Duration and Instant

Duration and Instant

Duration represents a signed time span and Instant represents a signed point-in-time on a monotonic timeline. the backend treats both as distinct Silk types that lower to i64 nanoseconds.

Full reference: duration instant.

Example: Duration arithmetic#

fn main () -> int {
  let a: Duration = 10ms;
  let b: Duration = 2s;
  let c: Duration = a + b;
  if c > a {
    return 0;
  }
  return 1;
}

See also#

Source repository · Edit this page · View Markdown