harshpandya Posted April 11, 2008 Share Posted April 11, 2008 Here is my code - I want Function test to execute only after 5 seconds.function test(){alert("After 5 sec");}function f2(){ setTimeout(test,500); }Problem is - Instead of 5 seconds delay - this program gives about 2 secods delay - which is very wired. Please Help Thanks, Link to comment Share on other sites More sharing options...
Ingolme Posted April 11, 2008 Share Posted April 11, 2008 The unit is miliseconds. 5 seconds is 5000 miliseconds, not 500, that's half a second.function test(){alert("After 5 sec");}function f2(){setTimeout("test()",5000);} Link to comment Share on other sites More sharing options...
harshpandya Posted April 14, 2008 Author Share Posted April 14, 2008 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.