Functions available to WebAssembly

Viewed 533

Does anyone know of a list of functions which are available to call from WebAssembly when running in a modern web browser?

Or perhaps the answer is that there are no such functions except the ones explicitly made available from JavaScript?

Specifically, I would like to know if it is possible to read a clock without the need to write JavaScript that calls Date.getTime() and then call that JavaScript from WebAssembly. My problem with that solution is that I assume doing so would have non-trivial overhead and I would like to read the clock often. Preferably the clock would not be affected by any jump in the local real time clock as I only need to measure the length of time intervals.

1 Answers

Your guess is correct: there are no specific Wasm functions in a browser. Any JavaScript function with a type that Wasm understands can be directly imported into and called from a Wasm module.

Related