Skip to main content
Inspiring
July 4, 2014
Answered

Script Running time log report

  • July 4, 2014
  • 1 reply
  • 1121 views

Hi,

Is there any possibilities to take the run time report for script running process. For instance I have to collect my script running time to close time as in log report.

by

hasvi

This topic has been closed for replies.
Correct answer Chinnadk

Hi,


Error showing "Illegal use of reserved word 'var'

on line "var minutes = Math.round(seconds/60);"


FYI:


by

hasvi


var start = new Date().getTime();

//Your scripts goes here.

var end = new Date().getTime();

var time = end - start;

var seconds = Math.round(time/1000);

var minutes = Math.round(seconds/60);

var hr = Math.round(minutes/60);

alert(hr + ":" + minutes + ":" + seconds);

1 reply

Chinnadk
Legend
July 4, 2014

Hi Hasvi,

Try this.

var start = new Date().getTime();

//Your scripts goes here.

var end = new Date().getTime();

var time = end - start;

alert("Execution time in seconds: " + time/60);

Regards,

Chinna

Jump_Over
Legend
July 4, 2014

Hi,

Notice that time is a number of miliseconds, so it supposed to be:

     alert("Execution time in seconds: " + time/1000);

Jarek

hasviAuthor
Inspiring
July 5, 2014

Hi,

I have check with one script, finally its showing alert message "Execution time in seconds: 338.258". Suddenly I can’t understand this time, is there any easy way to get time "Hours: Minutes: Seconds"

See below the calculation and its Result:

alert("Execution time in seconds: " + time/1000)-->Execution time in seconds: 338.258

alert("Execution time in seconds: " + time/60)-->Execution time in seconds: 6345.05

by

hasvi