setBuildTime method

void setBuildTime(
  1. String key,
  2. String widgetName,
  3. int costTime
)

Implementation

void setBuildTime(String key, String widgetName, int costTime) {
  if (!_performanceData.data.containsKey(key)) {
    _performanceData.data[key] = NodePerformanceData();
  }
  _performanceData.data[key]?.buildTime += costTime;
  _performanceData.buildTime += costTime;

  // 性能分析时使用
  if (!_performanceData.widget.containsKey(widgetName)) {
    _performanceData.widget[widgetName] = NodePerformanceData();
  }
  _performanceData.widget[widgetName]?.buildTime += costTime;
  _performanceData.widget[widgetName]?.createCount += 1;
}