Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ class FrameTiming {
FrameTiming(List<int> timestamps)
: assert(timestamps.length == FramePhase.values.length), _timestamps = timestamps;

/// Construct [FrameTiming] with given timestamp in micrseconds.
///
/// TODO(CareF): This is part of #20229. Remove back to default constructor
/// after #20229 lands and corresponding framwork PRs land.
FrameTiming.fromTimeStamps({
int? vsyncStart,
required int buildStart,
required int buildFinish,
required int rasterStart,
required int rasterFinish
}) : _timestamps = <int>[buildStart, buildFinish, rasterStart, rasterFinish];

/// This is a raw timestamp in microseconds from some epoch. The epoch in all
/// [FrameTiming] is the same, but it may not match [DateTime]'s epoch.
int timestampInMicroseconds(FramePhase phase) => _timestamps[phase.index];
Expand Down
12 changes: 12 additions & 0 deletions lib/web_ui/lib/src/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,18 @@ class FrameTiming {
: assert(timestamps.length == FramePhase.values.length),
_timestamps = timestamps;

/// Construct [FrameTiming] with given timestamp in micrseconds.
///
/// TODO(CareF): This is part of #20229. Remove back to default constructor
/// after #20229 lands and corresponding framwork PRs land.
FrameTiming.fromTimeStamps({
int? vsyncStart,
required int buildStart,
required int buildFinish,
required int rasterStart,
required int rasterFinish
}) : _timestamps = <int>[buildStart, buildFinish, rasterStart, rasterFinish];

/// This is a raw timestamp in microseconds from some epoch. The epoch in all
/// [FrameTiming] is the same, but it may not match [DateTime]'s epoch.
int timestampInMicroseconds(FramePhase phase) => _timestamps[phase.index];
Expand Down