I've created a C function that can be run from Angular/TypeScript/JavaScript using WebAssembly.
testWebAssembly() {
Module.ccall("aCFunction", null, [], []); // takes a few seconds to finish
}
This particular function involves complex mathematical calculations and may take a couple of seconds to complete. When triggered by a button click event:
<button (click)="testWebAssembly()">Launch C function</button>
Is there a way to execute this function without causing the web application's UI to freeze?
I attempted to use setTimeOut
, async
, and Promise
, but had difficulty getting it to work properly.
Your advice would be greatly appreciated!