From: george anzinger <george@mvista.com>
To: Der Herr Hofrat <der.herr@mail.hofr.at>
Cc: Simon Butcher <pickle@alien.net.au>,
"Serguei I. Ivantsov" <admin@gsc-game.kiev.ua>,
linux-gcc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Measure time
Date: Wed, 08 May 2002 16:22:12 -0700 [thread overview]
Message-ID: <3CD9B324.F3251957@mvista.com> (raw)
In-Reply-To: 200205081658.g48GwmV06862@hofr.at
Der Herr Hofrat wrote:
>
> >
> > 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.
The high-res-timers patch provides clock_gettime() with resolution to
the TSC increment. But you need to understand that this is a system
call which can take on the order of 1000 or these units. Add in a
little cach hit/ miss and interrupt randomness and well...
Still, there it is. Check out the web site below.
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
next prev parent reply other threads:[~2002-05-08 23:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-08 8:48 Measure time Serguei I. Ivantsov
2002-05-08 12:00 ` Der Herr Hofrat
2002-05-08 15:46 ` Serguei I. Ivantsov
2002-05-08 15:46 ` Serguei I. Ivantsov
2002-05-08 16:25 ` Nate
2002-05-08 16:40 ` george anzinger
2002-05-08 16:40 ` george anzinger
2002-05-08 16:51 ` Simon Butcher
2002-05-08 16:51 ` Simon Butcher
2002-05-08 16:58 ` Der Herr Hofrat
2002-05-08 23:22 ` george anzinger [this message]
2002-05-08 16:26 ` Calin A. Culianu
2002-05-08 16:26 ` Calin A. Culianu
2002-05-08 12:21 ` Richard B. Johnson
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=3CD9B324.F3251957@mvista.com \
--to=george@mvista.com \
--cc=admin@gsc-game.kiev.ua \
--cc=der.herr@mail.hofr.at \
--cc=linux-gcc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pickle@alien.net.au \
/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.