Javascript Pause Script

42 views
Skip to first unread message

whoami

unread,
Jan 3, 2008, 7:15:32 AM1/3/08
to phpguru
This is javascript which pause at particular line, whereas siteTimeout
function carry on execution on the next line.

<script language="javascript">
function pausecomp(millis){
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date < millis);
}

alert("Testing message");
pausecomp(5000);
alert("Testing message2");
</script>
Reply all
Reply to author
Forward
0 new messages