console.log("Inicio script"); function benchmark() { return new Promise(function (resolve, reject) { let t=0; for (let i=0; i<10000; i++) { for (let j=0; j<100000; j++) { t++; } } console.log(t); resolve(t); }); } console.log("Creo promesa"); let test=benchmark(); console.log("Suscripción"); test.then((result) => { console.log("resuelto"); console.log(result); }) console.log("Fin script");