Python time module - clock_getres(clk_id),clock_gettime(clk_id), clock_settime(clk_id, time)
<p>According to Python 3.5 documenation (time module) all three functions  <code>clock_getres(clk_id), clock_gettime(clk_id)</code> and <code>clock_settime(clk_id, time)</code> are available for Unix Systems. According to documentation: </p>

<blockquote>
  <p><code>clock_getres(clk_id)</code>  Return the resolution (precision) of the
  specified clock <code>clk_id</code> </p>
  
  <p><code>clock_gettime(clk_id)</code> Return the time of the specified  clock <code>clk_id</code></p>
  
  <p><code>clock_settime(clk_id, time)</code> Set the time of the specified clock
  <code>clk_id</code></p>
</blockquote>

<p>But Python documenation doesn't say anything about <code>clk_id</code>.
Can someone explain me how to get <code>clk_id</code> using python.</p>

<p>Basically clk_id it is integer id of clock, list of clock you can find at: <a href="https://docs.python.org/3/library/time.html" rel="nofollow">https://docs.python.org/3/library/time.html</a></p>

<p>for example <strong>time.CLOCK_REALTIME</strong> == 0 and <strong>time.CLOCK_MONOTONIC</strong> == 1, etc
for each clock you can set the time and surely time is different for every single one as well.</p>

<pre><code>import time

clock_id_realtime = time.CLOCK_REALTIME
clock_id_monotonic = time.CLOCK_MONOTONIC
print('clock_id_realtime = %s' % clock_id_realtime)
print('clock_id_monotonic = %s' % clock_id_monotonic)

clock_realtime_time = time.clock_gettime(clock_id_realtime)
clock_monotonic_time = time.clock_gettime(clock_id_monotonic)

print('clock_realtime_time = %s' % clock_realtime_time)
print('clock_monotonic_time = %s' % clock_monotonic_time)

try:
    print(time.clock_settime(clock_id_realtime, clock_realtime_time))
except PermissionError:
    print('No permissions to change clock time')
</code></pre>

python python-3.5