diff --git a/ica-rs/plugins/md5/md5-api.js b/ica-rs/plugins/md5/md5-api.js index 289213a..5824cbf 100644 --- a/ica-rs/plugins/md5/md5-api.js +++ b/ica-rs/plugins/md5/md5-api.js @@ -207,17 +207,20 @@ function wrap_any(names, round) { } function main() { return __awaiter(this, void 0, void 0, function () { - var fs, path, names, result; + var fs, path, names, start_time, result, end_time; return __generator(this, function (_a) { switch (_a.label) { case 0: fs = require("fs"); path = require("path"); names = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8"); - return [4 /*yield*/, wrap_any(names, 1000)]; + start_time = Date.now(); + return [4 /*yield*/, wrap_any(names, 10000)]; case 1: result = _a.sent(); + end_time = Date.now(); console.log(result); + console.log("Node.js \u8017\u65F6: ".concat(end_time - start_time, " ms")); return [2 /*return*/]; } }); diff --git a/ica-rs/plugins/md5/md5-api.ts b/ica-rs/plugins/md5/md5-api.ts index 3638c86..99c3259 100644 --- a/ica-rs/plugins/md5/md5-api.ts +++ b/ica-rs/plugins/md5/md5-api.ts @@ -195,8 +195,11 @@ async function main() { // const result = await fight(names); // const result = await md5_module.run_any(names, 50000); // console.log(`赢家:|${result.source_plr}|`); - const result = await wrap_any(names, 1000); + const start_time = Date.now(); + const result = await wrap_any(names, 10000); + const end_time = Date.now(); console.log(result); + console.log(`Node.js 耗时: ${end_time - start_time} ms`); } main();