Re: Measure time

Der Herr Hofrat (der.herr@mail.hofr.at)
Wed, 8 May 2002 18:58:47 +0200 (CEST)


>
> Hi,
>
> ftime() will return milliseconds, but it's considered an obsolete function.
> You could use gettimeofday() (as Richard Johnson suggested) to get
> microseconds and divide them to get milliseconds, although I don't know how
> time critical your routines are.
>
> If you're still looking for nanoseconds, I'm told you can use
> clock_gettime() but it's still quite unavailable (I've never seen it myself,
> yet).. however even if it was available you possibly wouldn't get a very
> high resolution from it with current systems..
>
clock_gettime() is available in the hard realtime extensions like RTLinux .
The clock resolution is limited to 32ns though - and atleast on X86 I don't
think there is a way to get below that.

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