Question: UPDATE 2:

OK, looks like it runs the first time after a minute. How do I get it to run onload, then every minute after that?

**UPDATE 1:**

I've tried: `var interval = setInterval(get_reported_incidents, 60000);` but nothing happens. in `get_reported_incidents();` I just have an `alert("hello");`.

**ORIGINAL QUESTION:**

I want to run a function every minute:

```
get_reported_incidents();

```

But I am not sure which method is best for this task;

`settimeout` or `setinterval`

Answer: 
It's totally personal preference. `setInterval` has some odd edge cases around what happens when the previous interval's code hasn't finished running before the next interval is due to start (not a problem if your interval is every *minute*; intervals every second, which one sometimes wants, get a bit tricky).

I tend to prefer chained `setTimeout` calls (where each schedules the next) because they can't run away with you — your code always has to explicitly say "Okay, and call me back again next time." But properly-written code should work with either.

Chained `setTimeout` calls are also more well-suited to asynchronous operations, like for instance polling something via ajax, because you don't schedule the next timeout until the ajax operation *completes*. Using `setInterval`, because the ajax calls are asynchronous, you could end up overlapping them.
Using `setinterval` would be the more natural choise. If you use `setTimeout`, you have to start a new timeout from the event handler.

```
window.setInterval(get_reported_incidents, 60*1000);

```