Re: 2.6.15:kernel/time.c: The Nanosecond and code duplication

From: Andi Kleen
Date: Mon Feb 13 2006 - 05:10:33 EST


"Ulrich Windl" <ulrich.windl@xxxxxxxxxxxxxxxxxxxx> writes:

> but there's no POSIX like syscall interface
> (clock_getres, clock_gettime, clock_settime) yet.

% grep clock include/asm-x86_64/unistd.h
#define __NR_clock_settime 227
__SYSCALL(__NR_clock_settime, sys_clock_settime)
#define __NR_clock_gettime 228
__SYSCALL(__NR_clock_gettime, sys_clock_gettime)
#define __NR_clock_getres 229
__SYSCALL(__NR_clock_getres, sys_clock_getres)
#define __NR_clock_nanosleep 230
__SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep)

Has been available for quite some time.

However the calls are currently slower than gettimeofday and also
don't use nanoseconds internally in all cases (depends on the architecture),
but still microseconds. But I'm not sure it matters that much
because the underlying timers are often not better than microseconds
anyways and with nanoseconds you start to time even the inherent system
call latency.



-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/