delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/10/25/12:33:00

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Andris Pavenis <pavenis AT latnet DOT lv>
To: djgpp AT delorie DOT com
Subject: Re: Timer inside interrupt handler
Date: Mon, 25 Oct 2004 19:37:11 +0300
User-Agent: KMail/1.7.1
References: <clee5f$j5s$1 AT coranto DOT ucs DOT mun DOT ca>
In-Reply-To: <clee5f$j5s$1@coranto.ucs.mun.ca>
MIME-Version: 1.0
Message-Id: <200410251937.11224.pavenis@latnet.lv>
Reply-To: djgpp AT delorie DOT com

On Saturday 23 October 2004 23:15, Jason Mills wrote:
> Does anyone have any suggestions as too what time functions
> can be safely called inside an interrupt handler? I
> need something with a resolution of > 80ms. Basically,
> I need a time stamp of when the IRS is called.
>
> I used uclock() originally, but I think it's causing
> some problems in other parts of my code. I'm aware of the
> other timing functions, but which one is "safest" to call
> inside the ISR? Is there a better way to get a time stamp
> inside an ISR then calling something like uclock().

If You are using CPU which supports rdtsr instruction (Intel Pentium and
above and some others support), then try to use it. Of course You need 
to know CPU clock frequency, but normally it's not difficult to get.

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019