Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/