Last active
May 19, 2025 06:52
-
-
Save antonkalik/ddd4c4ce308195df09e130a214e965c0 to your computer and use it in GitHub Desktop.
Fixed version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.time("Node Loop Benchmark"); | |
import Long from "long"; | |
let sum = Long.ZERO; | |
for (let i = 0; i < 1_000_000_000; i++) { | |
sum = sum.add(Long.fromInt(i)); // more efficient for small values | |
} | |
console.log("Sum:", sum.toString()); | |
console.timeEnd("Node Loop Benchmark"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment