<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Andrea Cervesato via ltp <<a href="mailto:ltp@lists.linux.it">ltp@lists.linux.it</a>> wrote:<br></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
static void setup(void)<br>
{<br><span class="gmail_default" style="font-size:small">...</span><br>
+ struct timespec time_res;<br>
+<br>
+ /*<br>
+ * We use CLOCK_MONOTONIC_COARSE resolution for all timers, since<br>
+ * we are sure its value is bigger than CLOCK_MONOTONIC and we can use<br>
+ * it for both realtime and virtual/prof timers resolutions.<br>
+ */<br>
+ SAFE_CLOCK_GETRES(CLOCK_MONOTONIC_COARSE, &time_res);<br>
+<br>
+ time_step = time_res.tv_nsec / 1000;<br>
+ if (time_step <= 0)<br>
+ time_step = 1000;<br>
+<br>
+ time_count = 3 * time_step;<br>
+<br>
+ tst_res(TINFO, "clock resolution: %luns, "<br></blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">I would use "low-resolution" for this output, but</div><div class="gmail_default" style="font-size:small">someone merge patch can help modify it.</div><br></div><div><div class="gmail_default" style="font-size:small">Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>></div></div><div><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>