Forum

Daniel
      Has 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)
    2 years ago #30147
    Up
    0
    Down
    ::

    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