From owner-freebsd-hackers Wed Jan 27 16:06:06 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA06140 for freebsd-hackers-outgoing; Wed, 27 Jan 1999 16:06:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from panzer.plutotech.com (panzer.plutotech.com [206.168.67.125]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA06135 for ; Wed, 27 Jan 1999 16:06:05 -0800 (PST) (envelope-from ken@panzer.plutotech.com) Received: (from ken@localhost) by panzer.plutotech.com (8.9.2/8.8.5) id RAA54630; Wed, 27 Jan 1999 17:05:54 -0700 (MST) From: "Kenneth D. Merry" Message-Id: <199901280005.RAA54630@panzer.plutotech.com> Subject: Re: Device statistics In-Reply-To: <199901272320.AAA23564@zed.ludd.luth.se> from Mattias Pantzare at "Jan 28, 99 00:20:14 am" To: pantzer@ludd.luth.se (Mattias Pantzare) Date: Wed, 27 Jan 1999 17:05:54 -0700 (MST) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28s (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mattias Pantzare wrote... > I am trying to teach iostat to print the percent of time the disk is busy > (transactions in progress), for that I use the information in struct devstat. > > The problem is that start_time is recorded using getmicrouptime. If I replace > that with getmicrotime I can do my magic. > > Is there a function that I missed that can get the same time > as getmicrouptim but in userspace? Try the kern.boottime sysctl variable. That's what w/uptime uses to figure out how long the machine has been up. You can subtract the current time from the boot time to get the uptime. I used getmicrouptime(), since it increases monotonically, unlike the regular system time. (e.g., you're running xntpd, and it steps the time back some) > Current temperature 99-01-28 00:19:17 -40.7 degrees Celsius (-41.2F) Wow, is that temperature accurate? Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message