mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Added a benchmark for JS
This commit is contained in:
18
tests/benchmarks/fizzbuzz.js
Normal file
18
tests/benchmarks/fizzbuzz.js
Normal file
@@ -0,0 +1,18 @@
|
||||
for (let counter = 1; counter <= 10000; counter++) {
|
||||
let result = "";
|
||||
|
||||
if (counter % 3 == 0) {
|
||||
result += "fizz";
|
||||
}
|
||||
|
||||
if (counter % 5 == 0) {
|
||||
result += "buzz";
|
||||
}
|
||||
|
||||
if (result != "") {
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
console.log(counter);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user