Add performance measuring

This commit is contained in:
Florian Schroedl 2024-06-11 10:24:12 +02:00
parent a5b22d5427
commit efd4c5dcca

View file

@ -69,7 +69,8 @@
(js/window.StyleDictionary. js-data))) (js/window.StyleDictionary. js-data)))
(comment (comment
(let [math-token-id (random-uuid) (let [performance-start (js/window.performance.now)
math-token-id (random-uuid)
dynamic-token-id (random-uuid) dynamic-token-id (random-uuid)
tokens-data {:dimension {"scale" {"value" "2px" tokens-data {:dimension {"scale" {"value" "2px"
"type" :sizing} "type" :sizing}
@ -92,7 +93,11 @@
;; (.formatPlatform sd "json") ;; (.formatPlatform sd "json")
(.buildAllPlatforms sd "json") (.buildAllPlatforms sd "json")
(.catch js/console.error) (.catch js/console.error)
(.then #(js/console.log "Finished" (.-allTokens %))))) (.then (fn [resp]
(let [performance-end (js/window.performance.now)
duration-ms (- performance-end performance-start)]
(js/console.log "Time elapsed" duration-ms "ms")
(js/console.log "Finished" (.-allTokens resp)))))))