public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Lewin A.R.W. Edwards" <larwe@larwe.com>
To: Grant Edwards <grante@visi.com>
Cc: Cristiano Ligieri Pereira <cpereira@ics.uci.edu>,
	ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] Functions to consume CPU time in x86
Date: Wed, 28 Mar 2001 12:31:00 -0000	[thread overview]
Message-ID: <4.3.2.7.2.20010328152838.026878a0@mail.larwe.com> (raw)
In-Reply-To: <20010328141816.A3802@visi.com>

> > >And of course I want to be able to specify that I want to keep the CPU
> > >busy for specific X (mili/nano)seconds and not only keep it busy for some
> > >randon amount of time.
>
>Unless you've got access to a hardware counter (with a known
>clock rate), you're going to have to tune a delay loop for your

Oh, one silly thing I forgot - On Pentium and higher x86 CPUs, you have the 
TSC MSR which is incremented every CPU clock cycle. You can use this to 
measure elapsed time. For very small values this will obviously not be an 
accurate technique for yielding delays, though.

=== Lewin A.R.W. Edwards (Embedded Engineer)
Work: http://www.digi-frame.com/
Personal: http://www.zws.com/ and http://www.larwe.com/

"Und setzet ihr nicht das Leben ein,
Nie wird euch das Leben gewonnen sein."

  reply	other threads:[~2001-03-28 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-28 10:26 Cristiano Ligieri Pereira
     [not found] ` <Pine.SOL.4.20.0103281120510.11565-100000@washoe.ics.uci.ed>
2001-03-28 11:26 ` Cristiano Ligieri Pereira
2001-03-28 12:08   ` Lewin A.R.W. Edwards
2001-03-28 12:17     ` Grant Edwards
2001-03-28 12:31       ` Lewin A.R.W. Edwards [this message]
2001-03-28 12:35         ` Grant Edwards
2001-03-29 11:50   ` Nick Garnett
2001-03-29 11:50 ` Hugo Tyson

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=4.3.2.7.2.20010328152838.026878a0@mail.larwe.com \
    --to=larwe@larwe.com \
    --cc=cpereira@ics.uci.edu \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=grante@visi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).