Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

DurationRealLiterals

Constructs a finite f64-count Nanoseconds duration from exact real token text.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.time

import std.time;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

ParseNanosecondsRealToken

pub consteval fn ParseNanosecondsRealToken(Text: str) -> Duration<f64, 1_u64, 1000000000_u64>

Constructs a finite f64-count Nanoseconds duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMicrosecondsRealToken

pub consteval fn ParseMicrosecondsRealToken(Text: str) -> Duration<f64, 1_u64, 1000000_u64>

Constructs a finite f64-count Microseconds duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMillisecondsRealToken

pub consteval fn ParseMillisecondsRealToken(Text: str) -> Duration<f64, 1_u64, 1000_u64>

Constructs a finite f64-count Milliseconds duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseSecondsRealToken

pub consteval fn ParseSecondsRealToken(Text: str) -> Duration<f64, 1_u64, 1_u64>

Constructs a finite f64-count Seconds duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMinutesRealToken

pub consteval fn ParseMinutesRealToken(Text: str) -> Duration<f64, 60_u64, 1_u64>

Constructs a finite f64-count Minutes duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseHoursRealToken

pub consteval fn ParseHoursRealToken(Text: str) -> Duration<f64, 3600_u64, 1_u64>

Constructs a finite f64-count Hours duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseDaysRealToken

pub consteval fn ParseDaysRealToken(Text: str) -> Duration<f64, 86400_u64, 1_u64>

Constructs a finite f64-count Days duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseWeeksRealToken

pub consteval fn ParseWeeksRealToken(Text: str) -> Duration<f64, 604800_u64, 1_u64>

Constructs a finite f64-count Weeks duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMonthsRealToken

pub consteval fn ParseMonthsRealToken(Text: str) -> Duration<f64, 2629746_u64, 1_u64>

Constructs a finite f64-count Months duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseYearsRealToken

pub consteval fn ParseYearsRealToken(Text: str) -> Duration<f64, 31556952_u64, 1_u64>

Constructs a finite f64-count Years duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseDecadesRealToken

pub consteval fn ParseDecadesRealToken(Text: str) -> Duration<f64, 315569520_u64, 1_u64>

Constructs a finite f64-count Decades duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseCenturiesRealToken

pub consteval fn ParseCenturiesRealToken(Text: str) -> Duration<f64, 3155695200_u64, 1_u64>

Constructs a finite f64-count Centuries duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMillenniaRealToken

pub consteval fn ParseMillenniaRealToken(Text: str) -> Duration<f64, 31556952000_u64, 1_u64>

Constructs a finite f64-count Millennia duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseMillionYearsRealToken

pub consteval fn ParseMillionYearsRealToken(Text: str) -> Duration<f64, 31556952000000_u64, 1_u64>

Constructs a finite f64-count MillionYears duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

ParseBillionYearsRealToken

pub consteval fn ParseBillionYearsRealToken(Text: str) -> Duration<f64, 31556952000000000_u64, 1_u64>

Constructs a finite f64-count BillionYears duration from exact real token text.

Required evaluation uses the shared nearest-even IEEE decoder with charged compiler work/scratch storage. No input is retained or runtime parser invoked. The rational unit remains type information; no approximate unit scaling occurs. Text: Exact suffix-free decimal spelling with optional folded sign. Return: Owned finite f64 duration; malformed/nonfinite-range input fails compilation.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library