systime_ns

datetime

Returns the current system time in nanoseconds

Syntax

systime_ns()

Returns

number

System time in nanoseconds since epoch

Examples

Get high-precision timestamp
Input:
systime_ns()
Output:
1735124445123456789
Add high-precision timestamps
Input:
map({precise_ts: systime_ns()})
Output:
Add nanosecond timestamp to records
Compute precise durations
Input:
(systime_ns() - .start_ns) / 1000000000
Output:
Calculate elapsed seconds from nanoseconds

The systime_ns() function returns the current system time in nanoseconds since the Unix epoch, providing high-precision timing.

Usage

Use systime_ns() for high-precision timing measurements, performance benchmarking, or when you need sub-second timestamp accuracy.