title: Find the processor speed of an iOS device
body: <p>I would like to have a function that returns the processor speed of an iOS device. </p>
  
  <p>I found what I thought might be a solution with this:</p>
  
  <pre><code>#include &lt;CoreService/CoreService.h&gt;
  
  long getProcessorClockSpeed()
  {
      OSErr err;
      long result;
      err=Gestalt(gestaltProcClkSpeed,&amp;result);
      if (err!=nil)
          return 0;
      else
          return result;
  }
  </code></pre>
  
  <p>but this doesn't compile. (CoreService.h file not found). Apparently, this is for Mac OS and not iOS?</p>
  
  <p>I have written and optimized a signal processing algorithm that can now just barely run in real time on an iPhone 4S. I would like to allow the algorithm to run on dual-core devices with a clock speed of 800 MHz or more, and disallow it on other devices. I am already able to get the number of cores, but I have not been able to get the CPU clock speed.</p>
  
  <p>I could do something like get the model of the device, and then allow or disallow the algorithm on devices based on that string, but that kind of table-based approach would need to be updated as new devices become available or would impose assumptions about new devices.</p>
  
  <p>Is there an idiomatic way for getting the CPU clock speed?</p>
  
  <p>Kudos awarded for:
  1) an approach that won't get my app rejected
  2) an approach that is less headache than a model-name-table-based approach?</p>