Skip to content

Commit

Permalink
Move emscripten_date_now/emscripten_performance_now. NFC (emscripten-…
Browse files Browse the repository at this point in the history
…core#22973)

These are not HTML5 specific, they both work under node too. Better for
them to live alongside `emscripten_get_now`.
  • Loading branch information
sbc100 authored Nov 20, 2024
1 parent 16c9628 commit c7f8724
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,10 @@ addToLibrary({

emscripten_random: () => Math.random(),

emscripten_date_now: () => Date.now(),

emscripten_performance_now: () => {{{ getPerformanceNow() }}}(),

#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
Expand Down
4 changes: 0 additions & 4 deletions src/library_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -2486,10 +2486,6 @@ var LibraryHTML5 = {
return requestAnimationFrame(tick);
},

emscripten_date_now: () => Date.now(),

emscripten_performance_now: () => {{{ getPerformanceNow() }}}(),

emscripten_get_device_pixel_ratio__proxy: 'sync',
emscripten_get_device_pixel_ratio: () => {
#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL
Expand Down

0 comments on commit c7f8724

Please sign in to comment.