I have written a C function that I am able to execute from Angular/TypeScript/JavaScript using WebAssembly:
testWebAssembly() {
Module.ccall("aCFunction", null, [], []); // takes a few seconds to finish
}
This function does some heavy mathematical calculations and needs a few seconds to finish. It is fired when a user clicks a button:
<button (click)="testWebAssembly()">Launch C function</button>
Is it possible to execute the function so that it does not block the UI of the web application?
I tried setTimeOut
/async
/Promise
, but I don't seem to be able to make it work.
Thank you!