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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!feeder.news-service.com!newsfeed101.telia.com!nf02.dk.telia.net!news.tele.dk!news.tele.dk!small.news.tele.dk!bnewspeer01.bru.ops.eu.uu.net!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Delay while wait for a command Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <287e1264-70c7-4cbb-8ee6-a63d2980071e@o10g2000yqa.googlegroups.com> Date: Tue, 29 Sep 2009 14:46:19 +0200 Message-ID: <1rot84c6nrutr.1r2ehrck4wen4.dlg@40tude.net> NNTP-Posting-Date: 29 Sep 2009 14:46:19 CEST NNTP-Posting-Host: 681e7974.newsspool4.arcor-online.net X-Trace: DXC=5HbQmm8Ab5h<6cDJZfMd_c4IUKkgbH>Xd8A;7j8f X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8531 Date: 2009-09-29T14:46:19+02:00 List-Id: 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: Done_At := Clock + 5.0; ... -- Upon an event if Clock < Done_At then Count := Count + 1; end 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. Kazakov http://www.dmitry-kazakov.de