Article View: borland.public.cppbuilder.nativeapi
Article #2648Re: Delays less than 1ms
From: Boba
Date: Wed, 24 Jan 2007 03:01
Date: Wed, 24 Jan 2007 03:01
25 lines
1878 bytes
1878 bytes
"Alberto" <dibene@usa.net> wrote in message news:45b6a64d@newsgroups.borland.com... > Hello all, > > the Sleep(1) call puts the program in a hold status for at least 1ms > (nominal...). > I am interfacing some external hardware in my program, and I need to > insert a small delay between consecutive operations. But 1ms is too > much, the overall response time becomes too sluggish. I reckoned that 50 > to 100 usec would do nicely. > > Is there a simple way to do that ? > > A possible solution could be to use the QueryPerformanceCounter API, > then do a spin loop waiting for 100 usec to be elapsed, but of course a > spin loop is a no-no in a multitasking system like Windows. > I am open to suggestions, thanks. > > Alberto Straight from "About Multimedia Timers": "Multimedia timer services allow applications to schedule timer events with the greatest resolution (or accuracy) possible for the hardware platform. These multimedia timer services allow you to schedule timer events at a higher resolution than other timer services." HTH Boba
Technical Details
Message-ID:
<45b6cbac@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45b6a64d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f9da0ba2269a64ec X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Boba" <Boba@somewhere.world> Newsgroups: borland.public.cppbuilder.nativeapi References: <45b6a64d@newsgroups.borland.com> Subject: Re: Delays less than 1ms Date: Tue, 23 Jan 2007 21:01:28 -0600 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 NNTP-Posting-Host: 65.243.37.30 Message-ID: <45b6cbac@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1169607596 65.243.37.30 (23 Jan 2007 18:59:56 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail