PerformanceInfo constructor

PerformanceInfo({
  1. Duration? networkTime,
  2. Duration? serverTime,
  3. Duration? transferTime,
  4. Duration? domProcessingTime,
  5. Duration? domCompletionTime,
  6. Duration? onloadTime,
})

Describes the performance of an action.

Note: Negative durations are invalid and will result in ArgumentErrors.

Implementation

factory PerformanceInfo({
  Duration? networkTime,
  Duration? serverTime,
  Duration? transferTime,
  Duration? domProcessingTime,
  Duration? domCompletionTime,
  Duration? onloadTime,
}) {
  assertDurationNotNegative(value: networkTime, name: 'networkTime');
  assertDurationNotNegative(value: serverTime, name: 'serverTime');
  assertDurationNotNegative(value: transferTime, name: 'transferTime');
  assertDurationNotNegative(
    value: domProcessingTime,
    name: 'domProcessingTime',
  );
  assertDurationNotNegative(
    value: domCompletionTime,
    name: 'domCompletionTime',
  );
  assertDurationNotNegative(value: onloadTime, name: 'onloadTime');

  return PerformanceInfo._(
    networkTime: networkTime,
    serverTime: serverTime,
    transferTime: transferTime,
    domProcessingTime: domProcessingTime,
    domCompletionTime: domCompletionTime,
    onloadTime: onloadTime,
  );
}