Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2012 13:54:26 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239139 - head/tools/tools/netmap
Message-ID:  <201208081354.q78DsQJ4090369@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Aug  8 13:54:26 2012
New Revision: 239139
URL: http://svn.freebsd.org/changeset/base/239139

Log:
  Round displayed pps (instead of truncating)

Modified:
  head/tools/tools/netmap/pkt-gen.c

Modified: head/tools/tools/netmap/pkt-gen.c
==============================================================================
--- head/tools/tools/netmap/pkt-gen.c	Wed Aug  8 09:42:44 2012	(r239138)
+++ head/tools/tools/netmap/pkt-gen.c	Wed Aug  8 13:54:26 2012	(r239139)
@@ -1076,7 +1076,7 @@ main(int arc, char **argv)
 		pps = toc.tv_sec* 1000000 + toc.tv_usec;
 		if (pps < 10000)
 			continue;
-		pps = (my_count - prev)*1000000 / pps;
+		pps = ((my_count - prev) * 1000000 + pps / 2) / pps;
 		D("%" PRIu64 " pps", pps);
 		prev = my_count;
 		toc = now;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208081354.q78DsQJ4090369>