it's not running parallel like i thought it would....
# suitescript
d
it's not running parallel like i thought it would. If it takes about 4 sec to create/save a customer record, it's taking 20 seconds for it to run 5 promises, or if i run it:
Copy code
var cust1 = createCustomer('promisd', 'testing', '', '<mailto:promisedtesting@nautilus.com|promisedtesting@nautilus.com>');
      var cust2 = createCustomer('promisdd', 'testing', '', '<mailto:promiseddtesting@nautilus.com|promiseddtesting@nautilus.com>');
      var cust3 = createCustomer('promisddd', 'testing', '', '<mailto:promisedddtesting@nautilus.com|promisedddtesting@nautilus.com>');
      var cust4 = createCustomer('promisddd', 'testing', '', '<mailto:promiseddddtesting@nautilus.com|promiseddddtesting@nautilus.com>');

      Promise.all([cust1, cust2, cust3, cust4]).then((values)=>{
        log.debug({title: 'promise all', details: values});
        log.debug({title: 'promise all', details: `${Date.now()-startTime} ms`});
      });
it still takes ~16 sec for it to run, so either i'm doing it wrong, or netsuite isn't allowing it
b
Hey well you saved me some time because I've been wanting to run similar tests. Even if they don't run async, I still think there's a structural/maintenance benefit to using them. Nesting callbacks can get nasty.
Nice work!