setEnabled method

void setEnabled(
  1. bool enabled
)

Enables or disables profiling

Implementation

void setEnabled(bool enabled) {
  // assertions are not included in production code so it is impossible to enable profiling in release mode
  assert(() {
    _enabled = enabled;
    return true;
  }());
  if (!enabled) {
    _activeSessions.clear();
  }
}