setInterval(function(){
/* your code here */
}, 5000);
And if you need to pass data to the function, you can do it with a closure:
setInterval(function(param){
return function(){
console.log(param);
};
}("hello"), 5000);
will print "hello" to the console.