(fiber: Fiber)
| 633 | } |
| 634 | |
| 635 | export function recordEffectDuration(fiber: Fiber): void { |
| 636 | if (!enableProfilerTimer || !enableProfilerCommitHooks) { |
| 637 | return; |
| 638 | } |
| 639 | |
| 640 | if (profilerStartTime >= 0) { |
| 641 | const endTime = now(); |
| 642 | const elapsedTime = endTime - profilerStartTime; |
| 643 | |
| 644 | profilerStartTime = -1; |
| 645 | |
| 646 | // Store duration on the next nearest Profiler ancestor |
| 647 | // Or the root (for the DevTools Profiler to read) |
| 648 | profilerEffectDuration += elapsedTime; |
| 649 | componentEffectDuration += elapsedTime; |
| 650 | |
| 651 | // Keep track of the last end time of the effects. |
| 652 | componentEffectEndTime = endTime; |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | export function recordEffectError(errorInfo: CapturedValue<mixed>): void { |
| 657 | if (!enableProfilerTimer || !enableProfilerCommitHooks) { |
no test coverage detected