Measuring performance
-
3 years, 5 months ago #30145
Hi all
in some situations, it takes quite a long time to get the response from my server-side business object. To measure the execution time as starting point for a refactoring, I want to use performance.now() (https://developer.mozilla.org/de/docs/Web/API/Performance/now). However, in the server-side BO, “performance” is not known. How could I use the performance object? Is there another/better way to measure the performance?
Thank you!
Daniel
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
3 years, 5 months ago #30147::Hi Christian,
you can use momentjs for this task:
var oStart = moment();
//perform logic e.g. connector calls
var oEnd = moment();var iDuration = oEnd.diff(oStart); //difference between start and end in milliseconds
output.duration = iDuration;For more information about the diff function of moment js please check the following page:
https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/07-difference/Best regards,
Dan
You must be logged in to reply to this topic.