diff --git a/src/library.js b/src/library.js index 991fa7952c1ca..800162151c8e8 100644 --- a/src/library.js +++ b/src/library.js @@ -1428,14 +1428,14 @@ addToLibrary({ emscripten_random: () => Math.random(), - emscripten_get_now: `; #if PTHREADS && !AUDIO_WORKLET - // Pthreads need their clocks synchronized to the execution of the main - // thread, so, when using them, make sure to adjust all timings to the - // respective time origins. - _emscripten_get_now = () => performance.timeOrigin + {{{ getPerformanceNow() }}}(); + // Pthreads need their clocks synchronized to the execution of the main + // thread, so, when using them, make sure to adjust all timings to the + // respective time origins. + emscripten_get_now: () => performance.timeOrigin + {{{ getPerformanceNow() }}}(), #else #if MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 || AUDIO_WORKLET // https://caniuse.com/#feat=high-resolution-time + emscripten_get_now: `; // AudioWorkletGlobalScope does not have performance.now() // (https://github.com/WebAudio/web-audio-api/issues/2527), so if building // with @@ -1449,14 +1449,14 @@ addToLibrary({ } else { _emscripten_get_now = Date.now; } +`, #else - // Modern environment where performance.now() is supported: - // N.B. a shorter form "_emscripten_get_now = performance.now;" is - // unfortunately not allowed even in current browsers (e.g. FF Nightly 75). - _emscripten_get_now = () => {{{ getPerformanceNow() }}}(); + // Modern environment where performance.now() is supported: + // N.B. a shorter form "_emscripten_get_now = performance.now;" is + // unfortunately not allowed even in current browsers (e.g. FF Nightly 75). + emscripten_get_now: () => {{{ getPerformanceNow() }}}(), #endif #endif -`, emscripten_get_now_res: () => { // return resolution of get_now, in nanoseconds #if ENVIRONMENT_MAY_BE_NODE diff --git a/test/other/codesize/test_codesize_cxx_lto.gzsize b/test/other/codesize/test_codesize_cxx_lto.gzsize index 853c6b04ea600..a665dbc2e401e 100644 --- a/test/other/codesize/test_codesize_cxx_lto.gzsize +++ b/test/other/codesize/test_codesize_cxx_lto.gzsize @@ -1 +1 @@ -8354 +8347 diff --git a/test/other/codesize/test_codesize_cxx_lto.jssize b/test/other/codesize/test_codesize_cxx_lto.jssize index 6578a71cf4816..a356df5369581 100644 --- a/test/other/codesize/test_codesize_cxx_lto.jssize +++ b/test/other/codesize/test_codesize_cxx_lto.jssize @@ -1 +1 @@ -20427 +20408 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.gzsize b/test/other/codesize/test_codesize_minimal_pthreads.gzsize index 69a8eaf5a510b..538bf8bc94115 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.gzsize +++ b/test/other/codesize/test_codesize_minimal_pthreads.gzsize @@ -1 +1 @@ -4916 +4913 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.jssize b/test/other/codesize/test_codesize_minimal_pthreads.jssize index 6cc48c769c974..71538ce26cffd 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.jssize +++ b/test/other/codesize/test_codesize_minimal_pthreads.jssize @@ -1 +1 @@ -10465 +10458