Log time to first paint (#1775)

* Log time to first paint

* Fix TS
zio/stable
dan 2023-10-31 02:07:14 +00:00 committed by GitHub
parent d5c7b8ceb8
commit ef1d6ee490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -467,6 +467,12 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
theme={theme}
onReady={() => {
SplashScreen.hideAsync()
const initMs = Math.round(
// @ts-ignore Emitted by Metro in the bundle prelude
performance.now() - global.__BUNDLE_START_TIME__,
)
console.log(`Time to first paint: ${initMs} ms`)
// Register the navigation container with the Sentry instrumentation (only works on native)
if (isNative) {
const routingInstrumentation = getRoutingInstrumentation()