Skip to content

Commit

Permalink
add performance
Browse files Browse the repository at this point in the history
  • Loading branch information
PingHuskar committed May 12, 2024
1 parent 1aa48a6 commit 7b7f02d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bahtrext",
"version": "1.2.1",
"version": "1.2.2",
"description": "Better BahtText",
"main": "index.js",
"scripts": {
Expand Down
36 changes: 36 additions & 0 deletions performance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const pass = (val) => {
return
}

const performance = (money_array) => {
const THBText = require("thai-baht-text");
console.time("thai-baht-text");
for (const money of money_array) {
// console.log(THBText(money));
pass(THBText(money));
}
console.timeEnd("thai-baht-text");
return `return`;
};

const performanceBR = (money_array) => {
const BahtRext = require('./index');
console.time("BahtRext");
for (const money of money_array) {
// console.log(BahtRext.BF(money));
pass(BahtRext.BF(money));
}
console.timeEnd("BahtRext");
return `return`;
};

const performance_arr = [];
const performance_arr_s = [];

for (i = 1; i <= 1000000; i++) {
performance_arr.push(i);
performance_arr_s.push(`${i}`);
}

console.log(performanceBR(performance_arr_s));
console.log(performance(performance_arr));

0 comments on commit 7b7f02d

Please sign in to comment.