home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!think.com!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!alexia!cole
- From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
- Subject: Re: Is there a way of finding the CPU speed?
- References: <9301110.15206@mulga.cs.mu.OZ.AU>
- Message-ID: <C0qLBo.HtB@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois at Urbana
- Date: Tue, 12 Jan 1993 10:33:23 GMT
- Lines: 28
-
- In <9301110.15206@mulga.cs.mu.OZ.AU> mtc@mundil.cs.mu.OZ.AU (Michael Trevor
- CUTTER) writes:
-
- >Dear Netters,
-
- >Is there a way of finding out the CPU speed (i.e. 25MHz, 40MHz etc) on _any_
- >Macintosh? I know there is a trap for the Powerbooks, but it is not
- implemented
- >for any of the other systems.
-
- IM vol. 5 tells me of a system global at $d00 called TimeDBRA which is the
- number of times a DBRA instruction can be done per millisecond. Not precisely
- a clock speed rating, but then you really shouldn't need a clock speed rating,
- just some standard measure.
- I would NOT however count on these on older (pre-Mac II) models. A
- quick check on a Plus shows me that I can do NO DBRA's in a millisecond
- (indicating I suppose that the DBRA takes over 8000 cycles?) while the other
- timing constants for peripheral chips (TimeSCCDB for the SCC and TimeSCSIDB
- for the SCSI chip) seem to indicate an ability to perform these tasks in
- fractions of a clock cycle.
- And of course since none of the timing methods on teh Mac really count
- on chip speed, you really want to know how fast your code will run, right?
- There is always the option there of just finding out. Write a little routine
- that latches onto Ticks to exit a loop, and count how many times you get thru
- in a Tick. Make it approximate the sort of stuff you are doing, and see how
- fast the specific Mac is. This is potentially more discerning since it gives
- you a better sense of the real speed (affected by things like bus width, fpu,
- etc.) of the Mac.
-