Skip to content

Commit

Permalink
always measure how long gatherTranslations() takes (mdn#3536)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe authored Apr 16, 2021
1 parent ff9ba00 commit 709f5ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ function gatherTranslations() {

function translationsOf({ slug, locale: currentLocale }) {
if (TRANSLATIONS_OF.size === 0) {
const label = "Time to gather all translations";
console.time(label);
gatherTranslations();
console.timeEnd(label);
}
const translations = TRANSLATIONS_OF.get(slug.toLowerCase());
if (translations && currentLocale) {
Expand Down

0 comments on commit 709f5ae

Please sign in to comment.