lkml.org 
[lkml]   [2002]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question about cpu time accuracy.
Scribbling feverishly on May 12, Jennifer Huang managed to emit:
> Hi all,
>
> I have a question about cpu time accuracy.
>
> I am using kernel 2.4.18. But, when I tried "utime"
> and "nanosleep" to get a process suspended, it only
> worked in 10ms granularity, and it's no way to sleep
> for 1 microsecond.

The standard kernel timer has a resolution of 1/HZ, which is 10ms on
an x86. You could try a scheduling policy of SCHED_FIFO or SCHED_RR,
but this only gets you 2ms resolution.

> Anyone can help me out of this?

There are patches available for high resolution timers:

http://sourceforge.net/projects/high-res-timers/
http://www.cs.wisc.edu/paradyn/libhrtime/

Kurt
--
Anarchy may not be the best form of government, but it's better than no
government at all.
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.033 / U:1.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site