From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 21 22:22:13 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 2B3FE16A4CE for ; Fri, 21 Jan 2005 22:22:13 +0000 (GMT) Received: from 194-185-53-242.f5.ngi.it (194-185-53-242.f5.ngi.it [194.185.53.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3422943D39 for ; Fri, 21 Jan 2005 22:22:12 +0000 (GMT) (envelope-from mark@remotelab.org) Received: from einstein.lab (localhost. [127.0.0.1])j0LMMA0u059299; Fri, 21 Jan 2005 23:22:10 +0100 (CET) (envelope-from mark@remotelab.org) Received: from einstein.lab (localhost.lab [127.0.0.1]) by einstein.lab (8.13.1/8.13.1) with ESMTP id j0LMMAlJ003487; Fri, 21 Jan 2005 23:22:10 +0100 (CET) (envelope-from mark@einstein.lab) Received: (from mark@localhost) by einstein.lab (8.13.1/8.13.1/Submit) id j0LMM96Z003486; Fri, 21 Jan 2005 23:22:09 +0100 (CET) (envelope-from mark) Date: Fri, 21 Jan 2005 23:22:09 +0100 From: Marco Trentini To: Ryan Sommers Message-ID: <20050121222209.GA935@einstein.lab> References: <20050120004406.GF921@einstein.lab> <41EF137D.1090100@gamersimpact.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EF137D.1090100@gamersimpact.com> X-Operating-System: FreeBSD einstein.lab 6.0-CURRENT i386 User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: clock time in milliseconds into a c program X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list 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 22:22:13 -0000 On Wed, Jan 19, 2005 at 08:12:13PM -0600, Ryan Sommers wrote: > Marco Trentini wrote: > >Hi, I need to clock the function execution time into a C > >program. I know /usr/include/time.h library but I need to > >clock the time in milliseconds. > > > >Any suggestions, links? > > > > Are you looking for how long the processor spent executing your code? Or > the difference in wall time between when it enters the function and when > it exits the function? Second one. I need to clock (in a freely way) how long few linear algebraic functions spent computing the solution. I understand your observations on this topic. Anyway the gettimeofday's solution is good for me, thanks all. -- Marco Trentini mark@remotelab.org http://www.remotelab.org/