On this page
  1. time.time_ns
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

time.time_ns

Prev: time.time | Up: time | Next: time.tzset
Rel: time.asctime, time.clock_getres, time.clock_gettime, time.clock_gettime_ns
Ref: docs.python.org — time.time_ns
Tags: #public #python3 #stdlib #time


Import

import time
from time import time_ns

Signature & Overview

time.time_ns()

Return the current time in nanoseconds since the Epoch.

Usage

import time

now_ns = time.time_ns()
assert isinstance(now_ns, int) and now_ns > 1_700_000_000_000_000_000

Gotchas

REPL Inspect

from time import time_ns
help(time_ns)

Linked from

Related notes