How can I programatically find out the CPU frequency?[ ... ]
Here's a chunk of code from an old homework assignment from my days at CMU. :-)
This uses an iterative method to achieve results within a certain accuracy-- a few percent-- but it works as a normal user without requiring anything more than the standard Unix interval timers.
28-ns1% ./freq The clock frequency is approximately 395 Megahertz
29-ns1% dmesg | head
Copyright (c) 1992-2003 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 4.9-STABLE #9: Tue Dec 2 16:05:30 EST 2003
Timecounter "i8254" frequency 1193182 Hz
CPU: Pentium II/Pentium II Xeon/Celeron (399.86-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x652 Stepping = 2
_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"