Skip to content

Commit

Permalink
Using DOMHighResTimeStamp value for requestAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Jul 11, 2020
1 parent f89d9f4 commit 78c9676
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quickjs/quickjs_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,8 @@ void QuickJSBinder::frame() {
while (id) {
const ECMAScriptGCHandler &func = frame_callbacks.get(*id);
JSValueConst js_func = JS_MKPTR(JS_TAG_OBJECT, func.ecma_object);
JSValue argv[] = { JS_NewInt64(ctx, (int64_t)OS::get_singleton()->get_system_time_msecs()) };
double timestamp = OS::get_singleton()->get_ticks_usec() / 1000.0;
JSValue argv[] = { JS_NewFloat64(ctx, timestamp) };
JSValue ret = JS_Call(ctx, js_func, global_object, 1, argv);
JS_FreeValue(ctx, argv[0]);
if (JS_IsException(ret)) {
Expand Down

0 comments on commit 78c9676

Please sign in to comment.