sachin_namjoshi
Mega Patron

You can use below code for sleep function

 

 

 

  1. /* time is in milliseconds - this is essentially a "sleep" function */  
  2. wait: function(time){  
  3.   var t1 = new GlideDateTime().getNumericValue();  
  4.   var t2 = new GlideDateTime().getNumericValue();  
  5.   var duration = t2 - t1;  
  6.   while(duration < time){  
  7.   t2 = new GlideDateTime().getNumericValue();  
  8.   duration = t2 - t1;  
  9.   }  
  10. },  

 

 

from here: gs.sleep() in scoped application?

 

Regards,

Sachin