All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kurt Wall <kwall@kurtwerks.com>
To: Jennifer Huang <carrothh@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Question about cpu time accuracy.
Date: Sun, 12 May 2002 18:57:09 -0400	[thread overview]
Message-ID: <20020512185709.C623@marta> (raw)
In-Reply-To: <20020512223710.41173.qmail@web20109.mail.yahoo.com>

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.

  reply	other threads:[~2002-05-12 22:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-12 22:37 Question about cpu time accuracy Jennifer Huang
2002-05-12 22:57 ` Kurt Wall [this message]
2002-05-13  2:49   ` Jennifer Huang
2002-05-13  3:22     ` Question about cpu time accuracy. Er resolution! george anzinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020512185709.C623@marta \
    --to=kwall@kurtwerks.com \
    --cc=carrothh@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.