Article View: comp.os.ms-windows.programmer.win32
Article #2145Re: SetTimer
From: Christopher J. Black
Date: Tue, 06 Oct 1998 00:00
Date: Tue, 06 Oct 1998 00:00
25 lines
1683 bytes
1683 bytes
Read the doco ... SetTimer only has 55ms resolution (rounded up) so (int)(1000/30) = 33 , which becomes 55ms which means if the WM_TIMER message is never left in the queue then 90 WM_TIMER msgs will take approx. 5 sec. These are *not* real time OSs. You should always check clock-ticks if accuracy is important. If you really require 33 ms timers use multi-media timers, they can trigger at 1ms intervals (but have associated overheads). Good Luck ChrisB2 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:
<6vbpq0$70e$1@stallion.stallion.oz.au>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: "Christopher J. Black" <cblack@stallion.oz.au> Subject: Re: SetTimer Date: 1998/10/06 Message-ID: <6vbpq0$70e$1@stallion.stallion.oz.au> X-Deja-AN: 398110020 References: <3619553C.11D5@bigfoot.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Stallion Technologies Pty. Ltd. Newsgroups: comp.os.ms-windows.programmer.win32,borland.public.cpp.winapi