ng.profiler.timeChangeDetection() 如何工作?

Kri*_*eck 5 javascript google-chrome-devtools angular

我正在寻求ng.profiler.timeChangeDetection()帮助分析 Angular 应用程序。然而,有些事情仍不清楚。

\n

当我ng.profiler.timeChangeDetection({ record: true })从控制台运行时,我得到如下所示的输出。

\n
\n

common_tools.ts:64 运行 15 个更改检测周期\ncommon_tools.ts:65 每次检查 34.61 毫秒\n配置文件“更改检测”已启动。\n配置文件“更改检测”已完成。\nChangeDetectionPerfRecord\xc2\xa0{msPerTick: 34.61200000019744 , numTicks: 15}

\n
\n

如果我分析 chrome,然后ng.profiler.timeChangeDetection({ record: true })通过 chrome 开发工具控制台进入,我会看到类似的内容。

\n

在此输入图像描述

\n

所以我可以看到它似乎进行了配置文件更改检测,但是从什么点开始呢?

\n

文档(https://angular.io/api/platform-b ​​rowser/enableDebugTools)显示了如何运行该命令,但它们没有详细说明实际发生的情况。我正在寻找有关..的一些澄清。

\n
    \n
  1. 跑步ng.profiler.timeChangeDetection({ record: true })到底有什么作用?
  2. \n
  3. 是否ng.profiler.timeChangeDetection({ record: true })模拟页面刷新?
  4. \n
  5. 它是否会触发整个应用程序的更改检测?
  6. \n
  7. 在什么时候跟踪更改?它告诉我有15 个变更检测周期,但是什么事件触发了这些周期?
  8. \n
\n