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?


_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to