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

DurationIntegerLiterals

Constructs an exact integer Nanoseconds value from compiler-supplied 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.

ParseNanosecondsToken

pub consteval fn ParseNanosecondsToken(Text: str) -> Nanoseconds

Constructs an exact integer Nanoseconds value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMicrosecondsToken

pub consteval fn ParseMicrosecondsToken(Text: str) -> Microseconds

Constructs an exact integer Microseconds value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMillisecondsToken

pub consteval fn ParseMillisecondsToken(Text: str) -> Milliseconds

Constructs an exact integer Milliseconds value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseSecondsToken

pub consteval fn ParseSecondsToken(Text: str) -> Seconds

Constructs an exact integer Seconds value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMinutesToken

pub consteval fn ParseMinutesToken(Text: str) -> Minutes

Constructs an exact integer Minutes value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseHoursToken

pub consteval fn ParseHoursToken(Text: str) -> Hours

Constructs an exact integer Hours value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseDaysToken

pub consteval fn ParseDaysToken(Text: str) -> Days

Constructs an exact integer Days value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseWeeksToken

pub consteval fn ParseWeeksToken(Text: str) -> Weeks

Constructs an exact integer Weeks value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMonthsToken

pub consteval fn ParseMonthsToken(Text: str) -> Months

Constructs an exact integer Months value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseYearsToken

pub consteval fn ParseYearsToken(Text: str) -> Years

Constructs an exact integer Years value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseDecadesToken

pub consteval fn ParseDecadesToken(Text: str) -> Decades

Constructs an exact integer Decades value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseCenturiesToken

pub consteval fn ParseCenturiesToken(Text: str) -> Centuries

Constructs an exact integer Centuries value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMillenniaToken

pub consteval fn ParseMillenniaToken(Text: str) -> Millennia

Constructs an exact integer Millennia value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseMillionYearsToken

pub consteval fn ParseMillionYearsToken(Text: str) -> MillionYears

Constructs an exact integer MillionYears value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

ParseBillionYearsToken

pub consteval fn ParseBillionYearsToken(Text: str) -> BillionYears

Constructs an exact integer BillionYears value from compiler-supplied token text.

Runs only during compilation, with linear token parsing and constant storage. No allocation, synchronization or input retention occurs. Syntax/range failure is a required constant-evaluation failure. The unit remains an ordinary duration. Text: Exact suffix-free spelling, including a directly folded sign. Return: Owned i64-count duration in the selected rational seconds unit.

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