Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Created December 16, 2022 19:42
Show Gist options
  • Select an option

  • Save cmcdevitt/49f673ae5a7c40d0e42a7b41cdaa44fc to your computer and use it in GitHub Desktop.

Select an option

Save cmcdevitt/49f673ae5a7c40d0e42a7b41cdaa44fc to your computer and use it in GitHub Desktop.
Timing for JavaScript Function / Methods
//Top of Script / Function / Method
var start;
var end;
var dur;
start = new GlideDateTime();
// Function OR Method between start and end
end = new GlideDateTime();
dur = GlideDateTime.subtract(start, end);
gs.info("Duration for Function x is: " + dur.getDisplayValue());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment