Try the following and see if it makes any difference:
var ESP8266 = require("ESP8266");
ESP8266.logDebug(false);
s = getTime();
for (var i = 0; i < 25; i++) {
digitalWrite(D5, 1);
}
e = getTime();
console.log("Seconds:" + (e-s) / 25);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Try the following and see if it makes any difference: