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 52759ad commit a3bcf4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Sentry/SentryFramesTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ - (void)displayLinkCallback
}

CFTimeInterval frameDuration = lastFrameTimestamp - self.previousFrameTimestamp;
self.previousFrameTimestamp = lastFrameTimestamp;

if (frameDuration > self.slowFrameThreshold && frameDuration <= SentryFrozenFrameThreshold) {
atomic_fetch_add_explicit(&_slowFrames, 1, SentryFramesMemoryOrder);
Expand All @@ -134,6 +133,8 @@ - (void)displayLinkCallback
}

atomic_fetch_add_explicit(&_totalFrames, 1, SentryFramesMemoryOrder);

self.previousFrameTimestamp = lastFrameTimestamp;
}

# if SENTRY_TARGET_PROFILING_SUPPORTED
Expand Down

0 comments on commit a3bcf4a

Please sign in to comment.