How can I call a function every time a specified number of milliseconds elapses? Javascript has setInterval() function and I need something like that. Currently I use this: def function(): [...] t = threading.Timer(n, function) t.start() function()