Use of setInterval or setTimeout method
However you should always use requestAnimationFrame method in canvas animation in order to get smoother movement.
Qudusayo , I know this is offtopic, but did you get your profle from somewhere, or did you make it? (I saw it on Youtube).
Also, can you please show me how to do the request animation frame indeed (in the code)?