comp.lang.ada
 help / color / mirror / Atom feed
From: JPWoodruff@gmail.com
Subject: Re: Getting delay of two events
Date: 29 Dec 2006 13:19:03 -0800
Date: 2006-12-29T13:19:03-08:00	[thread overview]
Message-ID: <1167427143.749548.126410@73g2000cwn.googlegroups.com> (raw)
In-Reply-To: <1167320834.211528.106660@a3g2000cwd.googlegroups.com>


mark wrote:
> Hello,
>
> I have an external library with a task and a function getSync which
> returns boolean value (true if it is in sync position, false
> otherwise). Now I would like to create another task which will get the
> time between two sync (i.e. moments of time when the get_sync function
> returns true). Any ideas how can I make it??


I've been waiting to see somebody smarter than me say something
constructive, but since it's been quiet, I'll venture a guess

I'm thinking you can't use the interface you told us about to get the
result you seem to need.  Of course there are always compromises, but
here's my reasoning:

If you call getSync and get a false, you have no idea how long to wait
until a hypothetical subsequent call would yield true.   So at best
you'll measure with a precision bounded by the polling rate of your
caller.  Worse yet, if calls to getSync can go from true to false
without external action that you control, you might miss an interval of
"true" altogether.

On the other hand, if you could extend the library's interface so it
could call *your task*, then you might make some progress.  Depending
of course on *its* timing behavior.

John




  reply	other threads:[~2006-12-29 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-28 15:47 Getting delay of two events mark
2006-12-29 21:19 ` JPWoodruff [this message]
2006-12-30 14:33   ` Jeffrey Creem
2006-12-31 13:04     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox