Doing scripting tasks in JavaScript is painful.
I measured speed 5 times manually too before introducing the script. It gives more stable results.