Skip to content

Commit

Permalink
Add time taken
Browse files Browse the repository at this point in the history
  • Loading branch information
healeycodes committed Dec 29, 2023
1 parent 2ead2ff commit 64d619b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wasm/wat2wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const compile = (source) => {
WebAssembly.instantiate(wasmBuffer, {})
.then(result => {
const func = result.instance.exports.fib;
console.log('Calling with:', 10)
console.log('Result:', func(10));
console.log('Calling with:', 25)
const t = performance.now();
console.log('Result:', func(25));
console.log('Time:', performance.now() - t);
})
.catch(error => {
console.error('Error loading WebAssembly module:', error);
Expand Down

0 comments on commit 64d619b

Please sign in to comment.