code: function measureLifeCyclePerf(fn, debugID, timerType) {
    if (debugID === 0) {
      // Top-level wrappers (see ReactMount) and empty components (see
      // ReactDOMEmptyComponent) are invisible to hooks and devtools.
      // Both are implementation details that should go away in the future.
      return fn();
    }
  
    ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
    try {
      return fn();
    } finally {
      ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
    }
  }
docs: Separated into a function to contain deoptimizations caused by try/finally.