/    Sign up×
Community /Pin to ProfileBookmark

Hi

Does anyone here knows what the max value for setTimeout ms(2. param) is?
I have an application that I want to refresh every 12 hour. but I am not sure if it is working. Eg. the function is not executed.

I sure can test this out, but just want to know if anyone have any experience with this.

I just can not find any documentation on this.

The system is Linux – Mozilla 1.7

Thanks in advance
Best regards

T

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@ChikaraSep 27.2007 — I'm pretty sure that this is to large of a value. Since setTimeout is done in ms. 12 hours would be 43200000 ms.

You might need to use a more powerful language for this. Is the application wrote in js?
Copy linkTweet thisAlerts:
@thoandeauthorSep 27.2007 — Yes, the application is HTML - JS.

We want to refresh the screen every 12. hour. Right now I am doing that with

JS setTimeout(refreshPage, 43200*1000)

I am testing it right now and hopefully will get wiser by tomorrow ?

It works fine with 1 hour.

/t
Copy linkTweet thisAlerts:
@ChikaraSep 27.2007 — How important is it to refreash the page every 12 hours? I don't see how this would be useful to a user.

I'm not sure if this could be the problem but, is your webservice's timeout value effecting the page?

Lol. . . if nothing else you could just have 12 timeouts each one calls the next time out and the last one refreashes the page?
Copy linkTweet thisAlerts:
@hoangkcSep 27.2007 — the Max value of a numeric variable is [B]1.79E+308[/B], and it's very very bigger than 43.200.000 so you can use it as you want ?
Copy linkTweet thisAlerts:
@thoandeauthorSep 27.2007 — Well, it is not a web page but a TV-screen for display that runs 24/7

The screen shows a web page which runs a Flash application

The reason I want to do the refresh is that I am paranoid about memory leaks in the flash app or plug-in(uncomfirmed). I guess a page refresh would clear any leaks either from the flash/plugin or the Mozilla browser.

I will also try the HTML meta/@refresh element.

But I am curious about what the max value for the JS setTimout ms parameter is.

Best regards

T. Andersen
Copy linkTweet thisAlerts:
@Orc_ScorcherSep 27.2007 — Thanks to Mozilla's open source you can look up stuff like this, the only problem is finding it.

DOM_MAX_TIMEOUT_VALUE is defined [url=http://lxr.mozilla.org/mozilla/source/dom/src/base/nsGlobalWindow.cpp#224]here[/url]. PR_BIT(x) is defined as 1 << (x) and PRIntervalTime is a 32 bit integer, so the result is 1 << 31 or 2147483648.

Of course there's no guarantee that other browsers have the same limit.
×

Success!

Help @thoande spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...