🕐 Get current time in nanoseconds since Unix epoch.
Returns the current time as a nanosecond timestamp string, which is the standard format for OpenTelemetry timestamps.
Current time in nanoseconds as a string
const now = getCurrentTimeNanos();// Result: "1640995200000000000" (example timestamp)// Use in telemetry dataconst logRecord: LogRecord = { timeUnixNano: getCurrentTimeNanos(), observedTimeUnixNano: getCurrentTimeNanos(), // ... other fields}; Copy
const now = getCurrentTimeNanos();// Result: "1640995200000000000" (example timestamp)// Use in telemetry dataconst logRecord: LogRecord = { timeUnixNano: getCurrentTimeNanos(), observedTimeUnixNano: getCurrentTimeNanos(), // ... other fields};
🕐 Get current time in nanoseconds since Unix epoch.
Returns the current time as a nanosecond timestamp string, which is the standard format for OpenTelemetry timestamps.