delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Message-ID: | <3BC61E32.5D91CEEB@nc.rr.com> |
Date: | Thu, 11 Oct 2001 18:33:22 -0400 |
From: | Greg Smith <gsmith AT nc DOT rr DOT com> |
X-Mailer: | Mozilla 4.77 [en] (Windows NT 5.0; U) |
X-Accept-Language: | en |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | gettimeofday resolution |
I couldn't help but notice that gettimeofday() returns the same value for every 10ms time tick (times.cc is using GetSystemTimeAsFileTime). One of our developers noted that there are win32 functions QueryPerformanceFrequency and QueryPerformanceCounter that can be used to gain microsecond resolution at low cost. (See http://msdn.microsoft.com/library/en-us/winui/timers_6mk9.asp and http://msdn.microsoft.com/library/en-us/winui/timers_4z76.asp). These apparently reference a 64 bit counter called RDTSC present in pentium class processors (and above). I am also told that this is the method linux uses on intel to achieve microsecond resolution. I know, I know. I'll try to make it as few lines as possible ;-) Greg -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |