Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!altos!altos86!rcollins From: rcollins@altos86.Altos.COM (Robert Collins) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: How do I determine the clock speed? Keywords: Clock Speed Timer Message-ID: <4478@altos86.Altos.COM> Date: 10 Dec 90 16:41:11 GMT References: <1990Dec3.061630.22992@ux1.cso.uiuc.edu> <1069@idcapd.idca.tds.philips.nl> <1990Dec7.191240.7768@ux1.cso.uiuc.edu> Reply-To: rcollins@altos86.UUCP (Robert Collins) Organization: Altos Computer Systems, San Jose, CA Lines: 26 >robl@idca.tds.PHILIPS.nl (R. Luursema) writes: > >> Basically, you can't determine the CPU clockspeed of an arbitrary PC. >> Oh really? It isn't that hard. I've got a subroutine that is accurate to 1 decimal point (33Mhz = 33Mhz +- .1Mhz). For the majority of the time, it is 100% accurate. I'll give you a hint: * The timer chip has 838nS resolution * Execute 838 of the same instructions (with a known CPU_CLOCK count) and time them. I'll leave the rest of this as an excersize to the reader (the programmer), as I don't feel like reducing my competitive advantage in the job market. P.S. This algorithm as it stands will be good to about 60Mhz. -- "Worship the Lord your God, and serve him only." Mat. 4:10 Robert Collins UUCP: ...!sun!altos86!rcollins HOME: (408) 225-8002 WORK: (408) 432-6200 x4356