+
+bool IODTNVRAM::safeToSync(void)
+{
+ AbsoluteTime delta;
+ UInt64 delta_ns;
+ SInt32 delta_secs;
+
+ // delta interval went by
+ clock_get_uptime(&delta);
+
+ // Figure it in seconds.
+ absolutetime_to_nanoseconds(delta, &delta_ns);
+ delta_secs = (SInt32)(delta_ns / NSEC_PER_SEC);
+
+ if ((delta_secs > (_lastDeviceSync + MIN_SYNC_NOW_INTERVAL)) || _freshInterval)
+ {
+ _lastDeviceSync = delta_secs;
+ _freshInterval = FALSE;
+ return TRUE;
+ }
+
+ return FALSE;
+}