
var starttime
 
while (true) {
    starttime = Date.now()
    while(Date.now() - starttime < 500);
    console.log("running test3 js")
    // code block to be executed
  }

// while (Date.now() - startDate < 500);