From owner-freebsd-hackers Thu Oct 5 13: 2:53 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.matriplex.com (ns1.matriplex.com [208.131.42.8]) by hub.freebsd.org (Postfix) with ESMTP id 2B87737B502 for ; Thu, 5 Oct 2000 13:02:48 -0700 (PDT) Received: from mail.matriplex.com (mail.matriplex.com [208.131.42.9]) by mail.matriplex.com (8.9.2/8.9.2) with ESMTP id NAA38632 for ; Thu, 5 Oct 2000 13:02:47 -0700 (PDT) (envelope-from rh@matriplex.com) Date: Thu, 5 Oct 2000 13:02:47 -0700 (PDT) From: Richard Hodges To: freebsd-hackers@freebsd.org Subject: A decent way to get CPU idle time? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greetings! Is there a clean and decent way to find out the percentage of CPU idle time, like top and systat give? I have browsed the source for both, and neither appear to have a simple way of finding this information. I have already tried and rejected getloadavg. In my application, two main processes will always account for 95% or more of the activity. I suppose I could use RDTSC to grab the clock on my system calls, and figure a rudimentary sum of CPU activity, but that won't help me with the expensive file and socket calls. And I would pretty much have to guess about the CPU time spent in the kernel. Any ideas? Thanks. -Richard ------------------------------------------- Richard Hodges | Matriplex, inc. rh@matriplex.com | 769 Basque Way 775-886-6477 | Carson City, NV 89706 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message