473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SetTimeout Problem again - Please Help

Here is my code - I want Function test to execute only after 5 seconds.

Expand|Select|Wrap|Line Numbers
  1. function test(){
  2. alert("After 5 sec");
  3. }
  4.  
  5.  
  6. function  f2(){    
  7. setTimeout(test,500);    
  8. }
Problem is - Instead of 5 seconds delay - this program gives about 2 secods delay - which is very wired.

Please Help Thanks,
Apr 11 '08 #1
1 1167
I got it thanks - i was putting 500 instead of 5000


funny
Apr 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Frances Del Rio | last post by:
this code is supposed to flip imgs at intervals of one second, but it flipps them much faster, it seems it flips them all in that first second, the more seconds the faster it flips them, instead of...
4
by: Keon | last post by:
Hoi again... I trie to recall a function after 15 sec. the code I use is like this function reloads() { switch (stPage) { case 0: setTimeout("document.getElementById('myIframe').src...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
17
by: jshanman | last post by:
I am working on a timeline API that devevelopers can use to add a dynamic timeline to their sites. Here is a *working* demo of the basic interface. (it works for me anyway on ie6 & firefox 1.5)...
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
9
by: balakrishnan.dinesh | last post by:
hi frnds, Is there any function in PHP like setTimeout with same functionallity in javascript .. Thing is, In php we have a function call settimeout for socket , But i need the same...
7
by: Martin | last post by:
Can I have two setTimeouts running at the same time - with two different intervals? I want to start one timer and, before it times out, start another one I've tried this and they seems to...
19
by: liketofindoutwhy | last post by:
I did some animation using var oDiv = {}; oDiv.x = 100; oDiv.y = 100; oDiv.node = document.getElementById('divImage'); oDiv.node.style.position = "absolute"; oDiv.doAnimation = function()...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.