Skip to documentation
SplitScript
  • Language
  • Standard library
  • Guides
  • Migration

SplitScript reference / Instant / elapsed

Instant.elapsed

Method

Instant.elapsed() -> Duration

Returns the duration elapsed since this instant.

This is shorthand for reading the clock and calling durationSince.

Effects: allocates, reads runtime state

Runtime behavior: available everywhere; synchronous

Examples

Trigger after a debounce interval

let detectedAt = Instant.now()
if detectedAt.elapsed().totalMilliseconds() >= 250 {
    print("ready")
}
Generated from the SplitScript compiler's documentation catalogs.