Skip to content

Commit c7f8724

Browse files
authored
Move emscripten_date_now/emscripten_performance_now. NFC (#22973)
These are not HTML5 specific, they both work under node too. Better for them to live alongside `emscripten_get_now`.
1 parent 16c9628 commit c7f8724

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/library.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,10 @@ addToLibrary({
13631363

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

1366+
emscripten_date_now: () => Date.now(),
1367+
1368+
emscripten_performance_now: () => {{{ getPerformanceNow() }}}(),
1369+
13661370
#if PTHREADS && !AUDIO_WORKLET
13671371
// Pthreads need their clocks synchronized to the execution of the main
13681372
// thread, so, when using them, make sure to adjust all timings to the

src/library_html5.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,10 +2486,6 @@ var LibraryHTML5 = {
24862486
return requestAnimationFrame(tick);
24872487
},
24882488

2489-
emscripten_date_now: () => Date.now(),
2490-
2491-
emscripten_performance_now: () => {{{ getPerformanceNow() }}}(),
2492-
24932489
emscripten_get_device_pixel_ratio__proxy: 'sync',
24942490
emscripten_get_device_pixel_ratio: () => {
24952491
#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL

0 commit comments

Comments
 (0)