Quick check with just a laptop browser shows 202-205ms instead of ~1300ms
"use strict" // is really more perfomant
console.time("test")
var rounds = 10e7 // var is more natural = faster
var x = 1
var pi = 1
for (var i = 2; i < rounds + 2; i++) {
x *= -1
pi += x / (2 * i - 1)
}
pi *= 4
console.timeEnd("test")
Quick check with just a laptop browser shows 202-205ms instead of ~1300ms