The following are constants available on UNIX platforms that can be used as the value for the clk_id parameter:
|clk_id||clk_id constant th>||Meaning|
|0||time.CLOCK_REALTIME||System- wide real-time clock|
|1||time.CLOCK_PROCESS_CPUTIME_ID||High-resolution per-process timer from the CPU|
|2||time.CLOCK_MONOTONIC||It represents monotonic time since some unspecified starting point|
|3||time. CLOCK_THREAD_CPUTIME_ID||Thread-specific CPU-time clock|
|4||time.CLOCK_MONOTONIC_RAW||Similar to time.CLOCK_MONOTONIC, but provides access to a raw hardware-based time that is not subject to NTP adjustments|
time.clock_gettime() is only available on UNIX-like systems .
Syntax: time.clock_gettime (clk_id)
clk_id : A clk_id constant or an integer value representing clk_id of the clock.
Return type: This method returns a float value which represents the time (in seconds) of the specified clock clk_id.
Code # 1: Using the method
time.clock_gettime () b >
Value of system-wide real-time clock time: 1568587204.9810832 Value of monotonic clock time: 12282.050676627