I have a script or two running on Invoices and inv...
# suitescript
c
I have a script or two running on Invoices and invoicing feels slower than other portions of netsuite, is there a code or anything that I could put to see how long its taking my script to execute?
p
you could install the apm bundle from Netsuite
1000 1
also doubleclicking the netsuite logo can help a little 🙂
from experience, invoicing is amonst the slowest parts of netsuite
s
The simple answer is put a `var start/end = new Date()`call at the beginning and end and compare the milliseconds.
s
Another approach, if you want to time various sections of code, is to create a timing function that logs the time elapsed for different sections of code. Then you can break it up and review from the logs which parts are taking the longest. You can use this in all versions of SuiteScript (just need to change the log.debug line for SS1.0).
s
most modern browsers, say chrome also allow you to see how much(long) it's been loading on client side, you can use the developer mode and play around to see if it's something local that is causing the issue (also then comparing them with the double click on the netsuite logo...)
s
another option already built and tested is using profiling built into the NFT Logger. https://github.com/ExploreConsulting/netsuite-fasttrack-toolkit-ss2#autologging