There is a large difference which involves locking. The first approach, the while loop is going to lock up the user's cpu because it runs forever without stopping and will take up 100% of the processor. setInterval actually has a minimum amount which is implicit, and depends on the browser. I believe it is around 10ms. So, your setInterval is actually only running for a millisecond or so doing that simple update, once every 10ms. This is harsh on the processor, but will not require 100% of the processor and can be mitigated with task management by the operating system.