B2G/gecko/toolkit/components/places/tests/head_common.js
/**
 * Compares two times in usecs, considering eventual platform timers skews.
 *
 * @param aTimeBefore
 *        The older time in usecs.
 * @param aTimeAfter
 *        The newer time in usecs.
 * @return true if times are ordered, false otherwise.
 */
Compares two times in usecs, considering eventual platform timers skews.
@param aTimeBefore
The older time in usecs.
@param aTimeAfter
The newer time in usecs.
@return true if times are ordered, false otherwise.
Compares two times in usecs considering eventual platform timers skews . @param aTimeBefore The older time in usecs . @param aTimeAfter The newer time in usecs . @return true if times are ordered false otherwise .
function is_time_ordered(before, after) {
  let isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
  let skew = isWindows ? 20000000 : 0;
  return after - before > -skew;
}
function is_time_ordered ( before , after ) { let isWindows = ( "@mozilla.org/windows-registry-key;1" in Cc ) ; let skew = isWindows ? 20000000 : 0 ; return after - before > - skew ; }
Compares two times in usecs, considering eventual platform timers skews.
Compares two times in usecs considering eventual platform timers skews .
// Windows has an estimated 16ms timers precision, since Date.now() and // PR_Now() use different code atm, the results can be unordered by this // amount of time.  See bug 558745 and bug 557406. // Just to be safe we consider 20ms.