From owner-freebsd-hackers Thu Jan 2 3:34: 6 2003 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 38D9C37B401 for ; Thu, 2 Jan 2003 03:34:05 -0800 (PST) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5573743EC2 for ; Thu, 2 Jan 2003 03:34:04 -0800 (PST) (envelope-from vlm@netli.com) Received: (qmail 17896 invoked by uid 84); 2 Jan 2003 11:33:50 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.115536 secs); 02 Jan 2003 11:33:50 -0000 Received: from unknown (HELO netli.com) (172.17.1.38) by mx01-pal-lan.netli.lan with SMTP; 2 Jan 2003 11:33:50 -0000 Message-ID: <3E1423F9.6070007@netli.com> Date: Thu, 02 Jan 2003 03:35:21 -0800 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021117 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mario Sergio Fujikawa Ferreira Cc: FreeBSD-hackers@FreeBSD.org, Garrett Wollman Subject: Re: Timing with clock_gettime(2) (sysutils/clockspeed port) References: <20021223110426.2848.qmail@exxodus.fedaykin.here> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mario Sergio Fujikawa Ferreira wrote: > #define timing_diffi(x,y) \ > ( \ > (double) ( ((x)->t.tv_sec - (y)->t.tv_sec) + \ > (double) ( \ > ((x)->t.tv_nsec - (double) (y)->t.tv_nsec) * 4294967296.0 / 1e9 \ > ) \ > ) \ > ) [skip] > printf("Avg getpid() time = %lld nsec\n", timing_diffi(&end,&start)/iters); Please, please read `man 3 printf`. Consider using %f instead of %lld. -- Lev Walkin vlm@netli.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message