| clock_nanosleep (CLOCK_REALTIME, TIMER_ABSTIME, hrt2ts(expected - advance), NULL);
expected += period;
now = clock_gethrtime(CLOCK_MONOTONIC);
last_time = now;
do {
min_diff = 2000000000;
max_diff = -2000000000;
for (i = 0; i < ntests; i++) {
++cnt;
clock_nanosleep (CLOCK_REALTIME, TIMER_ABSTIME, hrt2ts(expected - advance), NULL);
now = clock_gethrtime(CLOCK_MONOTONIC);
if (absolute && advance && !mode) {
if (now < expected) {
rtl_delay (expected - now);
}
now = clock_gethrtime(CLOCK_MONOTONIC);
}
if (absolute) {
diff = now - expected;
} else {
diff = now - last_time - period;
if (diff < 0) {
diff = -diff;
}
}
if (diff < min_diff) {
min_diff = diff;
}
if (diff > max_diff) {
max_diff = diff;
}
expected += period;
last_time = now;
}
&n 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 |