Subscribe Bookmark RSS Feed

Calculate Elapsed Time for JSL Code to Run?

terapin

Community Trekker

Joined:

Jun 23, 2011

I was wondering if there is a way to calculate how much time a particular JSL program took to execute? I couldn't find any information in the JSL scripting guide regarding this. Any ideas?
3 REPLIES
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Look at the Tick Seconds() function.

Use it something like this:

start=tick seconds();

[some jsl]

end=tick seconds();

runtime=end-start;

-Jeff
-Jeff
gflex

Community Trekker

Joined:

Jun 23, 2011

alternatively, can capture current time and use for calculation or display. This example prints to log.

v_start_text = "STARTED:" || Format( Today(), "m/d/y h:m:s" );
Show( v_start_text );

// body of script here

v_end_text = "ENDED:" || Format( Today(), "m/d/y h:m:s" );
Show( v_end_text );
terapin

Community Trekker

Joined:

Jun 23, 2011

Thanks Jeff,

This is exactly what I was looking for.