Monday, January 10, 2022

ServiceNow backend script to wait for a few milliseconds

 function waitForTime(time){  

  var t1 = new GlideDateTime().getNumericValue();  

  var t2 = new GlideDateTime().getNumericValue();  

  var duration = t2 - t1;  

  while(duration < time){  

  t2 = new GlideDateTime().getNumericValue();  

  duration = t2 - t1;  

  }  

}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.