From 399a8a56e58ff0546612df4f6fcbd45d1bf6e6e9 Mon Sep 17 00:00:00 2001 From: Wu Jian Ping Date: Fri, 22 Jul 2022 14:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96bench=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binding/nodejs/tests/bench.app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binding/nodejs/tests/bench.app.js b/binding/nodejs/tests/bench.app.js index b0f5c6f..b1b1aeb 100644 --- a/binding/nodejs/tests/bench.app.js +++ b/binding/nodejs/tests/bench.app.js @@ -139,8 +139,7 @@ process.on('exit', code => { // 这边只算个总时间就够了 const diff = process.hrtime(startTime) const totalInNS = diff[0] * 1e9 + diff[1] - const took = totalInNS / 1e9 - console.log(`Bench finished, {cachePolicy: ${cachePolicy}, total: ${total}, took: ${took}s, cost: ${total === 0 ? 0 : (totalInNS / 1e6) / total}μs/op}`) + console.log(`Bench finished, {cachePolicy: ${cachePolicy}, total: ${total}, took: ${totalInNS / 1e9}s, cost: ${total === 0 ? 0 : (totalInNS / 1e3) / total}μs/op}`) } })