Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8354
8347
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20427
20408
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_pthreads.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4916
4913
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_pthreads.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10465
10458
Loading