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

BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [=?iso-8859-1?Q?S=E9bastien?= GAUME<sgaume@b2i-toulous (fwd)



>From owner-rtl Fri May 18 01:34:55 2001
Received: from mail.b2i-toulouse.com (host.97.67.23.62.rev.coltfrance.com [62.23.67.97])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4I7Yrr24917;
	Fri, 18 May 2001 01:34:54 -0600
Received: from b2i-toulouse.com (wilson.b2i-toulouse.com [192.168.0.25] (may be forged))
	by mail.b2i-toulouse.com (8.11.0/8.11.0) with ESMTP id f4I6Pld30391;
	Fri, 18 May 2001 08:25:47 +0200
Message-ID: <3B04D002.1CB12216@b2i-toulouse.com>
Date: Fri, 18 May 2001 09:32:19 +0200
From: =?iso-8859-1?Q?S=E9bastien?= GAUME <sgaume@b2i-toulouse.com>
Organization: b2i-toulouse
X-Mailer: Mozilla 4.75 [fr] (WinNT; U)
X-Accept-Language: fr
MIME-Version: 1.0
To: rtl@rtlinux.org, rtl@fsmlabs.com
Subject: gethrtime
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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