avoid kernel calls to read_hpet by replacing CLOCK_MONOTONIC with CLOCK_MONOTONIC_COARSE. This speeds up things a bit on low end devices (tested on WNR3500Lv2).

This commit is contained in:
John Törnblom 2012-09-06 13:16:29 +02:00
parent 967650ac86
commit 4300857586
2 changed files with 2 additions and 2 deletions

View file

@ -267,7 +267,7 @@ process_ts_packet(rawts_t *rt, uint8_t *tsb)
slp.tv_sec = d / 1000000;
slp.tv_nsec = (d % 1000000) * 1000;
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &slp, NULL);
clock_nanosleep(CLOCK_MONOTONIC_COARSE, TIMER_ABSTIME, &slp, NULL);
didsleep = 1;
}
t->s_pcr_last = pcr;

View file

@ -390,7 +390,7 @@ getmonoclock(void)
{
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
clock_gettime(CLOCK_MONOTONIC_COARSE, &tp);
return tp.tv_sec * 1000000ULL + (tp.tv_nsec / 1000);
}