trackStage<T> abstract method

T trackStage<T>(
  1. String label,
  2. T action(), {
  3. bool isExternal = false,
})

Tracks performance of action separately.

If performance tracking is enabled, tracks action as separate stage identified by label. Otherwise just runs action.

You can specify action as isExternal (waiting for some external resource like network, process or file IO). In that case action will be tracked as a single time slice from the beginning of the stage until completion of the Future returned by action.

Otherwise all separate time slices of asynchronous execution will be tracked, but waiting for external resources will be a gap.

Returns the value returned by action.

Async actions that return a Future are supported.

Implementation

T trackStage<T>(String label, T Function() action, {bool isExternal = false});