Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932124AbWBRT1d (ORCPT ); Sat, 18 Feb 2006 14:27:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932125AbWBRT1d (ORCPT ); Sat, 18 Feb 2006 14:27:33 -0500 Received: from quechua.inka.de ([193.197.184.2]:20959 "EHLO mail.inka.de") by vger.kernel.org with ESMTP id S932124AbWBRT1c (ORCPT ); Sat, 18 Feb 2006 14:27:32 -0500 From: be-news06@lina.inka.de (Bernd Eckenfels) To: linux-kernel@vger.kernel.org Subject: Re: How to find the CPU usage of a process Organization: Private Site running Debian GNU/Linux In-Reply-To: X-Newsgroups: ka.lists.linux.kernel User-Agent: tin/1.7.8-20050315 ("Scalpay") (UNIX) (Linux/2.6.13.4 (i686)) Message-Id: Date: Sat, 18 Feb 2006 20:27:23 +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 589 Lines: 18 Ulrich Drepper wrote: > That's after the fact. Programs which want to get the information > while running can use the CPU clocks: > > struct timespec ts; > if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0) > fatal("cannot get CPU time"); > /* result is in TS */ But thats only for yourself, right? Gruss Bernd - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/