We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script> // 1. c++ 代码 // int fib (int x) { // if (x <= 0) { // return 0; // } // if (x <= 2) { // return 1; // } // return fib(x - 1) + fib(x - 2); // } // 2. 输出到 https://mbebenita.github.io/WasmExplorer/ 生成 wat 并下载 // 3. 引入并执行 fetch('./test.wasm').then((res) => res.arrayBuffer()) .then((bytes) => WebAssembly.compile(bytes)) .then((mod) => { const ins = new WebAssembly.Instance(mod); const a = ins.exports; console.time('lib'); const res = a._Z3fibi(40); console.timeEnd('lib'); console.log(res); }) // js 版本 // function fib(x) { // if (x <= 0) { // return 0; // } // if (x <= 2) { // return 1; // } // return fib(x - 1) + fib(x - 2); // } // console.time('lib'); // const res = fib(40); // console.timeEnd('lib'); // console.log(res); </script> </head> <body> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: