Skip to content

Commit

Permalink
fix: don't advance previousFrameTimestamp until after recording for p…
Browse files Browse the repository at this point in the history
…rofiling
  • Loading branch information
armcknight committed Jun 24, 2022
1 parent 969a6bc commit 144a68b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryFramesTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ - (void)displayLinkCallback

CFTimeInterval frameDuration = lastFrameTimestamp - self.previousFrameTimestamp;

self.previousFrameTimestamp = lastFrameTimestamp;

if (frameDuration > slowFrameThreshold && frameDuration <= SentryFrozenFrameThreshold) {
atomic_fetch_add_explicit(&_slowFrames, 1, SentryFramesMemoryOrder);
# if SENTRY_TARGET_PROFILING_SUPPORTED
Expand All @@ -137,6 +135,8 @@ - (void)displayLinkCallback
}

atomic_fetch_add_explicit(&_totalFrames, 1, SentryFramesMemoryOrder);

self.previousFrameTimestamp = lastFrameTimestamp;
}

# if SENTRY_TARGET_PROFILING_SUPPORTED
Expand Down

0 comments on commit 144a68b

Please sign in to comment.