1 year ago

#72997

test-img

econobro

Trigger javascript to run in 15 minutes

How do I get a script to run in my browser with a timer of at least 15 minutes? Right now I'm running into an issue where standard browsers throttle time once a page becomes inactive, which is throwing out my timer. I can't figure out how to integrate a webworker although this seems like it could be a solution.

const timer = 1000 * 60 * 15

setTimeout(test, timer)

function test() {
    console.log("worked");
}

Is there another, simpler way to run the test function after 15 minutes other than a webworker? Or is there a video/tutorial that might help me figure out webworkers?

javascript

html

timer

scripting

0 Answers

Your Answer

Accepted video resources