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

time.clock_gettime_ns

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


Import

import time
from time import clock_gettime_ns

Signature & Overview

time.clock_gettime_ns(clk_id, /)

Return the time of the specified clock clk_id as nanoseconds (int).

Usage

import time

if hasattr(time, "clock_gettime_ns"):
    ns = time.clock_gettime_ns(time.CLOCK_MONOTONIC)
    assert isinstance(ns, int) and ns > 0

Gotchas

REPL Inspect

from time import clock_gettime_ns
help(clock_gettime_ns)

Linked from

Related notes