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: a07f3367d7,5bbb5e045a0f313 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!f16g2000yqm.googlegroups.com!not-for-mail From: Pablo Newsgroups: comp.lang.ada Subject: Re: Delay while wait for a command Date: Thu, 1 Oct 2009 07:31:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <287e1264-70c7-4cbb-8ee6-a63d2980071e@o10g2000yqa.googlegroups.com> <1rot84c6nrutr.1r2ehrck4wen4.dlg@40tude.net> NNTP-Posting-Host: 201.7.145.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1254407508 10442 127.0.0.1 (1 Oct 2009 14:31:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 1 Oct 2009 14:31:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f16g2000yqm.googlegroups.com; posting-host=201.7.145.1; posting-account=n9Sa1woAAACZc_iwSjaEkj9Lnt-XVrSr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8559 Date: 2009-10-01T07:31:48-07:00 List-Id: On 29 set, 09:46, "Dmitry A. Kazakov" wrote: > On Tue, 29 Sep 2009 05:13:52 -0700 (PDT), Pablo wrote: > > I need to find a way to count an event occurrence in a defined time > > interval. That is, for instance, I need to wait 5 seconds, and in > > meantime I need to count the number of occurrences of a method (which > > could be a mouse click). Could someone help me? Thanks. > > Hmm, that depends on what is "event", "count" and "wait". > > Obviously you can: > > =A0 =A0Done_At :=3D Clock + 5.0; > =A0 =A0... > =A0 =A0 =A0-- Upon an event > =A0 =A0if Clock < Done_At then > =A0 =A0 =A0 Count :=3D Count + 1; > =A0 =A0end if; > > Who waits for 5s? Is it a task? Is it blocked? Is the event signaled to > this task? Another task? And so on, including a specification of what is > the GUI library used, Win32 API, Gtk etc. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Thanks Dmitry, I already solved it.