home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21266 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.0 KB  |  40 lines

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