title: What is mach_absolute_time based on on iPhone
body: <p>I use this code to keep track of last reboot:</p>
  
  <pre><code>+ (float) secondsSinceLastReboot{
       return ((float)(mach_absolute_time())) * ((float)timebase.numer) / ((float)timebase.denom) / 1000000000.0f;
  }
  </code></pre>
  
  <p>I assumed mach_absolute_time() was based on last device boot time like it is on a mac. It doesn't seem to be based on that.  I actually have no idea what it is based on.</p>
  
  <p>Look at the following behaviour (today's date is <strong>2009-09-20</strong>):</p>
  
  <pre><code>lastRebootTime = [[NSDate date] addTimeInterval:-[self secondsSinceLastReboot]];
  //last Reboot Time will contain : 2009-09-20 07:42:14 +0100
  </code></pre>
  
  <p>I'm absolutely certain I did not reboot my device at that time. My device hasn't been booted in a week.  </p>
  
  <p>Furthermore, when I unhook my device from the cable and run this app , it seems that when the device goes to sleep, the lastRebootTime starts shifting in the future. It seems <code>mach_absolute_time</code> doesn't keep account for sleep time. Or am i wrong about this?</p>
  
  <p>I would really like to be able to get a timestamp from when the device last rebooted.  Any idea's?</p>