[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: (fwd)



>From owner-rtl Sun May 20 03:13:00 2001
Received: from hq.fsmlabs.com (localhost [[UNIX: localhost]])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4K9CuE04882
	for <rtl@rtlinux.org>; Sun, 20 May 2001 03:12:56 -0600
Received: (qmail 12525 invoked by uid 1000); 20 May 2001 09:07:59 -0000
Date: Sun, 20 May 2001 13:07:59 +0400
From: Michael Barabanov <baraban@fsmlabs.com>
To: S?bastien GAUME <sgaume@b2i-toulouse.com>
Cc: rtl@rtlinux.org
Subject: Re: [rtl] gethrtime
Message-ID: <20010520130758.A12478@fsmlabs.com>
References: <3B04D002.1CB12216@b2i-toulouse.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.17i
In-Reply-To: <3B04D002.1CB12216@b2i-toulouse.com>; from sgaume@b2i-toulouse.com on Fri, May 18, 2001 at 09:32:19AM +0200
Organization: FSMLabs

Internally all calculations are performed in nanoseconds, so there's no
drift.

Michael.

S?bastien GAUME (sgaume@b2i-toulouse.com) wrote:
> Hello,
> 
> I have a question about the "gethrtime" function.
> 
> This function, as said in the man pages, returns the time in
> nanoseconds. Which means that it converts the clock ticks into
> nanoseconds. As the clock period is unfortunately not an integer
> multiple of nanoseconds, the conversion will entail a rounding or
> truncation on the last digit.
> 
> Thus, when you ask a task to be periodic, you give the period in
> nanoseconds and I suppose this value is converted into clock ticks,
> which entails a rouding. Suppose a task is periodic, running in the
> oneshot mode. Periodically, the next wake up date is calculated in clock
> units. Because the period in clock unit is not equal to the period in
> nanoseconds, a drift should be seen, especially after a large number of
> periods.
> 
> In fact, after having done this test, I did not see such a drift. Do not
> think I am disapointed, I'm not ! I would like to know wether I am wrong
> in my assumptions or not, and if not, how the gethrtime function manages
> not to create a drift.
> 
> Thank you
> 
> Sebastien
> 
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/