[netperf-dev] netperf4 commit notice r158 - branches/glib_migration/src

raj at netperf.org raj at netperf.org
Fri Apr 14 12:56:09 PDT 2006


Author: raj
Date: 2006-04-14 12:56:08 -0700 (Fri, 14 Apr 2006)
New Revision: 158

Modified:
   branches/glib_migration/src/netsysstats_windows.c
Log:
sit and spin since Windows only knows time to 10ms but the perf counters go more precise

Modified: branches/glib_migration/src/netsysstats_windows.c
===================================================================
--- branches/glib_migration/src/netsysstats_windows.c	2006-04-14 17:56:21 UTC (rev 157)
+++ branches/glib_migration/src/netsysstats_windows.c	2006-04-14 19:56:08 UTC (rev 158)
@@ -147,6 +147,23 @@
 
   NETPERF_DEBUG_ENTRY(test->debug,test->where);
 
+  // it has been suggested that we might want to sit and spin until
+  // the next wall-clock tick before we snap the CPU counters. that
+  // would be done via:
+  // Spin until clock interrupt boundary
+  status = GetTickCount();
+  do {
+  } while (status == GetTickCount());
+
+  // however, I'm concerned that sitting and spinning might add too
+  // much to the CPU counters.  the same source that suggested the sit
+  // and spin pointed-out that if our intervals are more than say 10
+  // seconds, it may not really matter. food for thought.
+  // in the end I decided to go that way since the wall clock time
+  // under Windows - retrieved via the gettimeofday() (really
+  // g_get_current_time, which calls GetSystemTimeAsFileTime only
+  // increments in 10 ms increments!?!!!
+
   gettimeofday(timestamp,NULL);
   elapsed = (double)timestamp->tv_sec + ((double)timestamp->tv_usec /
                                          (double)1000000);



More information about the netperf-dev mailing list