Date: Tue, 27 Feb 2007 04:54:33 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/netstat if.c Message-ID: <200702270454.l1R4sXGe003975@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
bde 2007-02-27 04:54:33 UTC FreeBSD src repository Modified files: usr.bin/netstat if.c Log: 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 conversion. Revision Changes Path 1.67 +9 -7 src/usr.bin/netstat/if.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702270454.l1R4sXGe003975>