---
title: setInterval
framework: TVMLKit JS
role: symbol
role_heading: Function
platforms: [tvOS 9.0+]
path: tvmljs/1627337-setinterval
---

# setInterval

Repeatedly executes a given function at the given time interval.

## Declaration

```data
String setInterval(
    in Function func, 
    in Integer time
);
```

## Parameters

- `func`: The function to be executed.
- `time`: An integer value that defines, in milliseconds, how often the function is to repeat.

## Return Value

Return Value Returns a string containing an identifier for the interval just set.

## Discussion

Discussion Pass the identifier created by this function to the clearInterval function to stop the designated function from executing.

## See Also

### Automating Function Timing

- [clearInterval](tvmljs/1627411-clearinterval.md)
- [setTimeout](tvmljs/1627349-settimeout.md)
- [clearTimeout](tvmljs/1627416-cleartimeout.md)
