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

time.monotonic_ns

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


Import

import time
from time import monotonic_ns

Signature & Overview

time.monotonic_ns()

Monotonic clock, cannot go backward, as nanoseconds.

Usage

import time

t0 = time.monotonic_ns()
t1 = time.monotonic_ns()
assert isinstance(t1 - t0, int) and t1 >= t0

Gotchas

REPL Inspect

from time import monotonic_ns
help(monotonic_ns)

Linked from

Related notes