From 4fc7efd3b7149e451dc8cd53542ca8c56b7b3c24 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Thu, 4 Jul 2024 16:03:32 +0200 Subject: [PATCH] Restore performance measuring lines --- .../main/ui/workspace/tokens/style_dictionary.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/style_dictionary.cljs b/frontend/src/app/main/ui/workspace/tokens/style_dictionary.cljs index e4e965df72..911fbafe99 100644 --- a/frontend/src/app/main/ui/workspace/tokens/style_dictionary.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/style_dictionary.cljs @@ -53,7 +53,7 @@ "Resolves references and math expressions using StyleDictionary. Returns a promise with the resolved dictionary." [tokens & {:keys [debug?] :as config}] - (let [#_#_performance-start (js/window.performance.now) + (let [performance-start (js/performance.now) sd (tokens->style-dictionary+ tokens config)] (when debug? (js/console.log "StyleDictionary" sd)) @@ -61,12 +61,12 @@ (.buildAllPlatforms "json") (.catch js/console.error) (.then (fn [^js resp] - (let [#_#_performance-end (js/window.performance.now) - #_#_duration-ms (- performance-end performance-start) + (let [performance-end (js/performance.now) + duration-ms (- performance-end performance-start) resolved-tokens (.-allTokens resp)] - #_(when debug? - (js/console.log "Time elapsed" duration-ms "ms") - (js/console.log "Resolved tokens" resolved-tokens)) + (when debug? + (js/console.log "Time elapsed" duration-ms "ms") + (js/console.log "Resolved tokens" resolved-tokens)) resolved-tokens)))))) (defn humanize-errors [{:keys [errors value] :as _token}]