description

# streamTimelineTo static method

1. @Since.new('3.11')

void streamTimelineTo(

1. TimelineRecorder recorder, {
2. String? path,
3. List<TimelineStream> streams = const [TimelineStream.dart, TimelineStream.gc],
4. bool enableProfiler = false,
5. Duration samplingInterval = const Duration(microseconds: 1000),

})

Tells runtime to write timeline data using `recorder`.

Timeline recording is enabled for the whole runtime and not for any specific isolate or isolate group.

Once started timeline recording will continue until it is stopped by stopStreamingTimeline.

Some recorders write into a specific file (specified by `path`), while others write to system wide recording buffer.

The `streams` specifies which timeline streams to enable. Only TimelineStream.dart and TimelineStream.gc are enabled by default.

If `recorder` supports profiling data then setting `enableProfiler` to `true` will turn on sampling profiler, which will collect profiling samples with frequency specified by `samplingInterval`. These samples will then written into the timeline.

Throws ArgumentError iff:

- `path` is specified but `recorder` writes to a fixed location.
- `path` is not specified and `recorder` requires it.
- `enableProfiler` is `true` and `recorder` does not support writing out profiling data.
- `samplingInterval` is too small.

## Implementation

    @Since('3.11')
    external static void streamTimelineTo(
      TimelineRecorder recorder, {
      String? path,
      List<TimelineStream> streams = const [
        TimelineStream.dart,
        TimelineStream.gc,
      ],
      bool enableProfiler = false,
      Duration samplingInterval = const Duration(microseconds: 1000),
    });