profile<T> method

T profile<T>(
  1. T f(
      ),
    1. {ZoneSpecification zoneSpec}
    )

    Profile the provided function. Accepts optional ZoneSpecification or use the defaultZoneSpec

    Implementation

    T profile<T>(T Function() f, {ZoneSpecification zoneSpec}) {
      if(_profiling){
        throw StateError('Already Profiling');
      }
      _profiling = true;
      _st.start();
      return runZoned<T>(f, zoneSpecification: (zoneSpec ?? defaultZoneSpec));
    }