I'm trying to use getTime to set a timer for an image gallery. When I add an alert during the else block of imageWait() this function works perfectly but without the alert nothing happens. Any ideas why?
milliseconds=null;
galleryLoop();
function galleryLoop(){
date=new Date();
startTime=date.getTime();
milliseconds=5000;
imageWait();
}
function imageWait(){
date=new Date();
currentTime=date.getTime();
if(startTime+milliseconds<=currentTime)
alert('made it')
else
imageWait();
}