X-Original-To: pgsql-hackers-win32-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 168D5564D1; Mon, 7 Mar 2005 22:48:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30623-07; Mon, 7 Mar 2005 22:48:27 +0000 (GMT) Received: from ct.radiology.uiowa.edu (ct.radiology.uiowa.edu [129.255.60.186]) by svr1.postgresql.org (Postfix) with ESMTP id 7160A56495; Mon, 7 Mar 2005 22:48:16 +0000 (GMT) Received: from [192.168.1.11] (12-217-241-0.client.mchsi.com [12.217.241.0]) by ct.radiology.uiowa.edu (8.11.6/8.11.6) with ESMTP id j27MmC313707; Mon, 7 Mar 2005 16:48:12 -0600 Message-ID: <422CDA2A.1000105@arbash-meinel.com> Date: Mon, 07 Mar 2005 16:48:10 -0600 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dave Held Cc: pgsql-performance@postgresql.org, pgsql-hackers-win32@postgresql.org Subject: Re: [PERFORM] Help with tuning this query (with References: <49E94D0CFCD4DB43AFBA928DDD20C8F90261846B@asg002.asg.local> In-Reply-To: <49E94D0CFCD4DB43AFBA928DDD20C8F90261846B@asg002.asg.local> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3C838764BDD360BA5B5CDC40" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/56 X-Sequence-Number: 3014 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3C838764BDD360BA5B5CDC40 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dave Held wrote: >There is always clock(). It's mandated by ANSI C, but my docs say >that POSIX requires CLOCKS_PER_SEC == 1000000 regardless of actual >timer resolution, which seems a little brain-dead to me. > >__ >David B. Held > > My experience with clock() on win32 is that CLOCKS_PER_SEC was 1000, and it had a resolution of 55clocks / s. When I just did this: int main(int argc, char **argv) { int start = clock(); int now = start; cout << "Clock: " << CLOCKS_PER_SEC << endl; for(int i = 0; i < 10; ++i) { while(now == clock()) { // Do nothing } now = clock(); cout << now-start << "\t" << (now - start) / (double) CLOCKS_PER_SEC << endl; } } I got: Clock: 1000 16 0.016 31 0.031 47 0.047 62 0.062 78 0.078 93 0.093 109 0.109 125 0.125 141 0.141 156 0.156 Which is about 1/0.016 = 62.5 clocks per second. I'm pretty sure this is slightly worse than what we want. :) It might be better on other platforms, but on win32 clock() is most definitely *not* what you want. John =:-> --------------enig3C838764BDD360BA5B5CDC40 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCLNoqJdeBCYSNAAMRAirhAJ9F+kf/UrfrETjIkHsuNHlFD9HLlACgkxOo 9G1LiIrMDp6AhEwKYL04EPo= =vnxj -----END PGP SIGNATURE----- --------------enig3C838764BDD360BA5B5CDC40--