Article View: borland.public.cppbuilder.nativeapi
Article #11243Re: Finegrain Sleep
From: Benjamin Pratt
Date: Fri, 20 Feb 2004 19:15
Date: Fri, 20 Feb 2004 19:15
40 lines
2260 bytes
2260 bytes
> 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(). > That didn't sound entirely right to me, so I tested it. On my Athlon 900mhz, GetSystemTimeAsFileTime takes 0.00000000958222 seconds to execute GetTickCount takes 0.0000000135771 seconds to execute I averaged 10,000 calls in each case. However, the basic premise that GetSystemTimeAsFileTime isn't any better than GetTickCount is true. I also recorded one second of GetSystemTimeAsFileTime timestamps and one second of GetTickCount timestamps. In both cases, the resolution was exactly 10 milliseconds. ... 9:38.477 9:38.487 9:38.497 9:38.507 9:38.517 9:38.527 9:38.537 9:38.547 9:38.557 9:38.567 9:38.577 9:38.587 9:38.597 9:38.608 9:38.618 ... So both are using the same internal clock, which gets updated every 10 milliseconds on a single processor Win2K machine.
Technical Details
Message-ID:
<40365c30$1@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 11:40:17 PST From: "Benjamin Pratt" <benjamin.pratt.getridofthis@verizon.net> 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 11:15:05 -0800 Lines: 42 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: 24.130.93.201 Message-ID: <40365c30$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077304368 24.130.93.201 (20 Feb 2004 11:12:48 -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