0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00

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)))
(comment
(let [math-token-id (random-uuid)
(let [performance-start (js/window.performance.now)
math-token-id (random-uuid)
dynamic-token-id (random-uuid)
tokens-data {:dimension {"scale" {"value" "2px"
"type" :sizing}
@ -92,7 +93,11 @@
;; (.formatPlatform sd "json")
(.buildAllPlatforms sd "json")
(.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)))))))