While working on the DevTools profiler, I've noticed that durations are sometimes incorrect. This seems to be vaguely related to high/low priority state updates. Need to track this down more so I'm filing an issue for myself.
if (expirationTime > callbackExpirationTime) {
      
      return;
    } else {
      if (callbackID !== null) {
        
        
        cancelDeferredCallback(callbackID);
      }
    }
    
  } else {
    startRequestCallbackTimer();
  }
  callbackExpirationTime = expirationTime;
  const currentMs = now() - originalStartTimeMs;
  const expirationTimeMs = expirationTimeToMs(expirationTime);
  const timeout = expirationTimeMs - currentMs;
  callbackID = scheduleDeferredCallback(performAsyncWork, {timeout});
}
function onFatal(root) {
  root.finishedWork = null;
}
function onComplete(
  root: FiberRoot,
  finishedWork: Fiber,
  expirationTime: ExpirationTime,
) {
  root.pendingCommitExpirationTime = expirationTime;
  root.finishedWork = finishedWork;