Article View: comp.os.ms-windows.programmer.win32
Article #2146Re: SetTimer
From: Brett g Porter
Date: Tue, 06 Oct 1998 00:00
Date: Tue, 06 Oct 1998 00:00
30 lines
1924 bytes
1924 bytes
A couple of things: 1) The standard timer is driven by the standard BIOS timer tick, so you can't generate more than 18.2 timer events per second using SetTimer. To go faster, you'll have to use the multimedia timers (see the timeSet* functions, etc.) 2)If the timer generates another tick before your app has processed the last WM_TIMER message, it will NOT put another one on the queue. Also, WM_TIMER messages are low priority, and will only be given to your app if there are no other messages on the queue. -- // // reply to: // BgPorter at acm dot org // Robin Burrows wrote in message <3619553C.11D5@bigfoot.com>... >Hello, > >I'm trying to set up a timer with the following line: >SetTimer (hwnd, 1, 1000/30, NULL); >(30 interrupts per second) but the interval is nothing like that. For >example, I process 90 interrupts which should take 3 seconds, but it >takes more like 15. I am using a fprintf in my WM_TIMER, but the file >remains open so the buffering should absorb it, there is no other >lengthy code in there. What is the minimum gap between interrupts? Or am >I just being dense? Do I really have to use GetTickCount and compensate >for it myself? >
Technical Details
Message-ID:
<9teS1.4036$Dh6.8559641@news.rdc1.nj.home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3619553C.11D5@bigfoot.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113dfb,2b2eac0b958b7811 X-Google-Attributes: gid113dfb,public X-Google-Thread: 103bde,2b2eac0b958b7811 X-Google-Attributes: gid103bde,public From: "Brett g Porter" <BgPorter@NOacmSPAM.org> Subject: Re: SetTimer Date: 1998/10/06 Message-ID: <9teS1.4036$Dh6.8559641@news.rdc1.nj.home.com> X-Deja-AN: 398114380 Content-Transfer-Encoding: 7bit References: <3619553C.11D5@bigfoot.com> Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Mon, 05 Oct 1998 18:35:01 PDT Newsgroups: comp.os.ms-windows.programmer.win32,borland.public.cpp.winapi