From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 21 09:58:19 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16DAB16A4CE for ; Fri, 21 Jan 2005 09:58:19 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B64B43D1F for ; Fri, 21 Jan 2005 09:58:18 +0000 (GMT) (envelope-from dr.clau@gmail.com) Received: by wproxy.gmail.com with SMTP id 58so56166wri for ; Fri, 21 Jan 2005 01:58:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=kcnD9L49uHsElCS64qvkiS4txIB8oeTnloiUHUaB9Ovws5AQQxKc8iloMcPlo9xj+yGWJPK+ATkZUtFICjxFZ27J6apAFDVLkL6AxVP3QcmnRGMiLMPDhtgUAAuTkjCA/gvHG0LpDp2as9zZax7WWi8PoJ87aI7DaAyph17esvY= Received: by 10.54.39.41 with SMTP id m41mr196052wrm; Fri, 21 Jan 2005 01:58:17 -0800 (PST) Received: by 10.54.21.16 with HTTP; Fri, 21 Jan 2005 01:58:17 -0800 (PST) Message-ID: Date: Fri, 21 Jan 2005 11:58:17 +0200 From: Claudiu Dragalina-Paraipan To: Joseph Koshy In-Reply-To: <84dead72050120181965c70231@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050120004406.GF921@einstein.lab> <41EFBEA5.50007@spintech.ro> <84dead72050120181965c70231@mail.gmail.com> cc: freebsd-hackers@freebsd.org cc: Marco Trentini Subject: Re: clock time in milliseconds into a c program X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Claudiu Dragalina-Paraipan List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2005 09:58:19 -0000 Or you can use PERFMON. Check manual page for perfmon. It gives you access to internal counters of CPU. Of course this is a subjective measurement, since, AFAIK, the counters are not kept separately for every process, but for entire system, including kernel. Maybe repeating the same measurement for many times, with a system running no other CPU consumers, you will get a more accurate measurement . On Fri, 21 Jan 2005 02:19:15 +0000, Joseph Koshy wrote: > > I don't think there is a streight way to speed-up the default > > unix time resolution, which is, as far as i know, in > > microseconds. > > On i386 (and possibly amd64) platforms you can use the > RDTSC instruction to get a direct measure of processor > cycles elapsed. > > -- > FreeBSD Volunteer, http://people.freebsd.org/~jkoshy > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Claudiu Dragalina-Paraipan e-mail: dr.clau@gmail.com