Article View: borland.public.cppbuilder.nativeapi
Article #11221Re: Finegrain Sleep
From: Graham Reeds
Date: Fri, 20 Feb 2004 10:12
Date: Fri, 20 Feb 2004 10:12
31 lines
2283 bytes
2283 bytes
"Steve Aletto" <steve_alettoANTI@SPAMhotmail.com> wrote in message news:4035bee9@newsgroups.borland.com... > > GetTickCount() has a resolution of 10 or 15ms depending on > windows version. > > I this the poster needs something in the microsecond > range. > > > > GetSystemTimeAsFileTime() has a resolution of > 100-nanoseconds > > Good remark, but I think the call to the function itself > introduces a delay longer than the pause you wish. That's > why I think also GetSystemTimeAsFileTime() can't give a > _precision_ of 100ns although the _resolution_ is 100ns. And > I'm quite sure a call to GetSystemTimeAsFileTime() requires > a longer time then a call to GetTickCount(). I'm currently trying out QueryPerformanceCounter() and having a state machine to quickly switch between the states depending on the time. Seems to be working, and doesn't use 3 threads (the GUI, data-in, data-out). Thanks for the suggestions, but why does GetSystemTimeAsFileTime() give 100ns intervals. We use UTC here and I am pretty sure that UTC is 1microsecond - or is that 100ns? It's too early in the morning and I haven't had enough sleep:-( -- Graham Reeds, grahamr@omnieng.co.uk | http://omnieng.co.uk
Technical Details
Message-ID:
<4035dd66@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4033629c$1@newsgroups.borland.com> <40336c3f@newsgroups.borland.com> <40349ac7@newsgroups.borland.com> <4034d0ba@newsgroups.borland.com> <4034ecd4$1@newsgroups.borland.com> <4035bee9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,fed9196afef30d83 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-20 02:39:47 PST From: "Graham Reeds" <grahamr@omnieng.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <4033629c$1@newsgroups.borland.com> <40336c3f@newsgroups.borland.com> <40349ac7@newsgroups.borland.com> <4034d0ba@newsgroups.borland.com> <4034ecd4$1@newsgroups.borland.com> <4035bee9@newsgroups.borland.com> Subject: Re: Finegrain Sleep Date: Fri, 20 Feb 2004 10:12:35 -0000 Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 193.82.59.1 Message-ID: <4035dd66@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077271910 193.82.59.1 (20 Feb 2004 02:11:50 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail