var date = new Date();
date.setSeconds(date.getSeconds() + 1);
while (new Date() > date) {
You may find a full second to be a wait too long. If so, there is an alternative.
var date = new Date();
date.setMilliseconds(date.getMilliseconds() + 100);
while (new Date() > date) {
No comments:
Post a Comment