From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3674250054e18a5a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!73g2000cwn.googlegroups.com!not-for-mail From: JPWoodruff@gmail.com Newsgroups: comp.lang.ada Subject: Re: Getting delay of two events Date: 29 Dec 2006 13:19:03 -0800 Organization: http://groups.google.com Message-ID: <1167427143.749548.126410@73g2000cwn.googlegroups.com> References: <1167320834.211528.106660@a3g2000cwd.googlegroups.com> NNTP-Posting-Host: 67.165.212.253 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1167427150 10899 127.0.0.1 (29 Dec 2006 21:19:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 29 Dec 2006 21:19:10 +0000 (UTC) In-Reply-To: <1167320834.211528.106660@a3g2000cwd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 73g2000cwn.googlegroups.com; posting-host=67.165.212.253; posting-account=fJYhjA0AAADq5HS0Ommw0DzKlat-I76I Xref: g2news2.google.com comp.lang.ada:8041 Date: 2006-12-29T13:19:03-08:00 List-Id: 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