about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2023-10-31 02:07:14 +0000
committerGitHub <noreply@github.com>2023-10-31 02:07:14 +0000
commitef1d6ee490f7c74f9154d929d72efb0830f8da7d (patch)
tree574af578ad50966da9db3536e5a2ff9aecf56c34 /src
parentd5c7b8ceb83c182c88aa6321fcce341dc27ae682 (diff)
downloadvoidsky-ef1d6ee490f7c74f9154d929d72efb0830f8da7d.tar.zst
Log time to first paint (#1775)
* Log time to first paint

* Fix TS
Diffstat (limited to 'src')
-rw-r--r--src/Navigation.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 52235ad75..a75651987 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -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()