Article View: borland.public.cppbuilder.nativeapi
Article #4282Re: Timer
From: Hans J�nsson
Date: Tue, 28 Feb 2006 19:10
Date: Tue, 28 Feb 2006 19:10
37 lines
2506 bytes
2506 bytes
I am really grateful for this solution. hans "Remy Lebeau (TeamB)" <no.spam@no.spam.com> skrev i meddelandet news:44049c3f$1@newsgroups.borland.com... > > "Hans J�nsson" <042140773@telia.com> wrote in message > news:44047cc2@newsgroups.borland.com... > >> Start a timer when the word is presented, read the time >> when the person moves on to next word > > You don't need a timer for that. Simple call GetTickCount() when the word > is shown, and again when the word is finished. The difference between the > two values will be the elapsed time, in milliseconds. > >> by pressing something > > Pressing a button (or other control) is an action that relies on messages > being placed in, and retreived from, the message queue. So no matter how > fast your timer is, the overall calculation for the reading speed will be > slowed down by that. If your main thread is delayed in processing new > messages, your click actions will be delayed, and your calculation will be > inaccurate. > > About the only way I can think of to get real-time results at the > resolution > you are asking for is to use a global keyboard and/or mouse hook via the > SetWindowsHookEx() function in a DLL. When the user wants to move on to > the > next word, they simply press the keyboard, or move the mouse, or click the > mouse button (but not on anything specific). The hook(s) can track the > hardware notifications so it can react faster than waiting for the message > queue. > > > Gambit > >
Technical Details
Message-ID:
<4404a01b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44034cb3@newsgroups.borland.com> <44036c80$1@newsgroups.borland.com> <44047cc2@newsgroups.borland.com> <44049c3f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,da4cdffc4a8e862a X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: "Hans J�nsson" <042140773@telia.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <44034cb3@newsgroups.borland.com> <44036c80$1@newsgroups.borland.com> <44047cc2@newsgroups.borland.com> <44049c3f$1@newsgroups.borland.com> Subject: Re: Timer Date: Tue, 28 Feb 2006 20:10:15 +0100 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 62.20.173.7 Message-ID: <4404a01b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1141153819 62.20.173.7 (28 Feb 2006 11:10:19 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail