view Platforms/Wasm/WasmDelayedCallExecutor.js @ 431:26b90b110719 am-vsol-upgrade

added DelayedCallExecutor to avoid using sleep() in C++ that consumes 100% CPU once executed in WASM
author am@osimis.io
date Thu, 29 Nov 2018 19:25:15 +0100
parents
children 5055031f4a06
line wrap: on
line source

mergeInto(LibraryManager.library, {
  WasmDelayedCallExecutor_Schedule: function(callable, timeoutInMs/*, payload*/) {
    setTimeout(function() {
      WasmDelayedCallExecutor_ExecuteCallback(callable/*, payload*/);
    }, timeoutInMs);
  }
});