The main idea is to loop function forever as fast as possible, something like:
function tick(){
callAnotherFunction();
// waiting for callAnotherFunction() to finish...
// ...oh it's done -> call tick() again
/* I tried to call tick(); before and after the closing curly bracket,
but on the inside it leads to "Maximum call stack size exceeded"-ERROR
and on the outside it never calls the function again. */
}