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: 
`setTimeout` runs a command once after a period of time. `setInterval` runs a command every time interval.

So, to run `get_reported_incidents` every minute use `setInterval`.

```
var interval = setInterval(get_reported_incidents, 60000);

```
obviously `setinterval` might be easier to maintain in your case

```
get_reported_incidents(); //first call
var interval = setInterval(get_reported_incidents, 60000);

```

vs

```
var interval;
function timeout (){
    get_reported_incidents();
    interval=setTimeout(timeout, 60000);
}
timeout();

```