From owner-freebsd-questions@FreeBSD.ORG Fri Jan 9 15:12:25 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70FB616A4CE for ; Fri, 9 Jan 2004 15:12:25 -0800 (PST) Received: from amsfep15-int.chello.nl (amsfep15-int.chello.nl [213.46.243.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9121F43D2D for ; Fri, 9 Jan 2004 15:12:23 -0800 (PST) (envelope-from girgen@pingpong.net) Received: from palle.girgensohn.se ([213.89.138.245]) by amsfep15-int.chello.nlESMTP <20040109231221.NZGS3882.amsfep15-int.chello.nl@palle.girgensohn.se>; Sat, 10 Jan 2004 00:12:21 +0100 Received: from localhost (localhost [127.0.0.1]) by palle.girgensohn.se (8.12.9p2/8.12.9) with ESMTP id i09NCKkC076165; Sat, 10 Jan 2004 00:12:21 +0100 (CET) (envelope-from girgen@pingpong.net) Date: Sat, 10 Jan 2004 00:12:20 +0100 From: Palle Girgensohn To: freebsd-questions@freebsd.org Message-ID: <300110000.1073689940@palle.girgensohn.se> X-Mailer: Mulberry/3.1.0 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; FORMAT=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: how find out CPU clockrate? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2004 23:12:25 -0000 Hi! How can I programatically find out the CPU frequency? I'm trying to port a program from Linux, and it uses /proc/cpuinfo. $ cat /compat/linux/proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 14 stepping : 2 flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr cpu MHz : 349.20 bogomips : 349.20 Pretty neat, but it does not exist in FreeBSD, and sysctl does not give out this information. Grepping the dmesg.boot seems somewhat odd for a C program: $ dmesg | grep -i hz Timecounter "i8254" frequency 1193182 Hz CPU: Pentium II/Pentium II Xeon/Celeron (349.20-MHz 686-class CPU) Better ideas? /Palle