* Delay while wait for a command
@ 2009-09-29 12:13 Pablo
2009-09-29 12:46 ` Dmitry A. Kazakov
0 siblings, 1 reply; 3+ messages in thread
From: Pablo @ 2009-09-29 12:13 UTC (permalink / raw)
Hi people,
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Delay while wait for a command
2009-09-29 12:13 Delay while wait for a command Pablo
@ 2009-09-29 12:46 ` Dmitry A. Kazakov
2009-10-01 14:31 ` Pablo
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry A. Kazakov @ 2009-09-29 12:46 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Delay while wait for a command
2009-09-29 12:46 ` Dmitry A. Kazakov
@ 2009-10-01 14:31 ` Pablo
0 siblings, 0 replies; 3+ messages in thread
From: Pablo @ 2009-10-01 14:31 UTC (permalink / raw)
On 29 set, 09:46, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
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:
>
> 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. Kazakovhttp://www.dmitry-kazakov.de
Thanks Dmitry, I already solved it.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-01 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-29 12:13 Delay while wait for a command Pablo
2009-09-29 12:46 ` Dmitry A. Kazakov
2009-10-01 14:31 ` Pablo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox