Using setTimeout() for large values

javascript

Solution

You are calling `tweet` immediately and passing its return value to `setTimeout`.

You need to pass a function to `setTimeout`. You haven't included the code for `tweet`, but I'm going to assume that it doesn't `return` a function.

setTimeout(function () { tweet(name, type); }, 5 * 60 * 1000);

Problem

I'm trying to get an event to fire after five minutes. I'm using the following code: ``` setTimeout(tweet(name, type), 5 * 60 * 1000); ``` It is firing after a while, but not nearly five minutes (Usually two minutes or so, but sometimes it's instant.). What am I doing wrong? (I've also tried setting the time to `300000` instead, same problem.

Original source