cvs commit: src/usr.bin/netstat if.c

Bruce Evans bde at
Tue Feb 27 04:54:33 UTC 2007

bde         2007-02-27 04:54:33 UTC

  FreeBSD src repository

  Modified files:
    usr.bin/netstat      if.c 
  Use a periodic itimer instead of repeated calls to alarm() in
  sidewaysintpr().  This increases the accuracy of the per-interval
  counts when they are interpreted as rates.  Repeated calls to alarm(n)
  give an average interval that is about 2 ticks larger than n and has
  a large variance.  Periodic itimers normally get the average almost
  right but have similarly large variance (due to scheduling delays).
  Statistics utilities should use clock_gettime() to determine the
  actual interval, but it is still useful to maximize the accuracy of
  the interval, especially for cases like netstat -w where counts are
  displayed so the program cannot hide the inaccuracy in a rate
  Revision  Changes    Path
  1.67      +9 -7      src/usr.bin/netstat/if.c

More information about the cvs-src mailing list