timer - When does JavaScript interval stops? -


it may naive question need know answer.

this code,

setinterval(function() { /do stth./}, 1000);

i never cancel timer, need run long user on page, need know case memory leak, or when stop (ie, browser refresh, browser close)?

the problem can occur when "do something". if have other long running functions or additional intervals inside interval (a la javascript inception) run performace issues.

however, in cases, won't have problems.

when user refreshes browser, interval begin anew. when browser closed activity stops.

as long user doesn't refresh browser or leave page interval never end.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -