Date: Wed, 06 Feb 2002 18:39:12 +0100 From: Poul-Henning Kamp <phk@freebsd.org> To: arch@freebsd.org Subject: Timecounter patch for review... Message-ID: <10989.1013017152@critter.freebsd.dk>
next in thread | raw e-mail | index | archive | help
As I have warned about earlier, I have modfied the timecounter code to simplify the arithmetic at the bottom of it. http://phk.freebsd.dk/patch/timecounter.patch This patch changes timecounters to run off a fundamental data type "struct bintime" which is "time_t with 64 bit fractional seconds". This avoids a lot of the maddening constructs needed for arithmetic on timeval/timespec values: if (foo.tv_usec > 1000000) { foo.tv_usec -= 1000000; foo.tv_sec++; } In particular delta times as used for I/O statistics or process resource usage will be cheaper to computer. Conversions to/from the struct timeval/timespec is done with a single multiplication. Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10989.1013017152>