X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=3.4 required=5.0 	tests=AWL,BAYES_50,J_CHICKENPOX_45,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <494B1DBB.5040704@bigpond.com>
Date: Fri, 19 Dec 2008 15:06:19 +1100
From: fred <zfred@bigpond.com>
Reply-To: fred@delorie.com
User-Agent: Thunderbird 1.5.0.8 (Windows/20061025)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: gettimeofday - millisecond accuracy
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nschwotgx01p.mx.bigpond.com from [124.183.95.174] using ID zfred at Fri, 19 Dec 2008 04:00:15 +0000
X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.494B1C4F.0087,ss=1,fgs=0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

with my test of gettimeofday in cygwin it appears to be counting in 
milliseconds
rather than microseconds.

so I had a look at where it is coded, /winsup/cygwin/times.cc

...
gettimeofday (struct timeval *tv, void *tzvp)
{
  struct timezone *tz = (struct timezone *) tzvp;
  static bool tzflag;
  LONGLONG now = gtod.usecs ();
...

I notice there is
hires_ms NO_COPY gtod;


however lower down there is appears to be a hires_us
class coded.

So I am wondering what the story is behind this ?

I will look at testing some changes here and testing, just need to do a 
successful build from source
of as is first.....

I am looking for microsecond resolution, and see that hires_us is using 
QueryPerformanceFrequency/QueryPerformanceCounter,
so thats looking good I think?

I have code that does bitbanging to the parallel  port, it works 
perfectly under linux,  and would like
to see it work in cygwin also.

Thanks
 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

