Example showing the elapsed time.

The internal clock in JavaScript returns the number of milliseconds since midnight, January 1, 1970. By itself, that is a silly big number that is meaningless to most humans. However, it is not intended to be used by itself. One common way this is used is to display the elapsed time. For example, this program reads and saves in a variable to milliseconds when the page loads. Then, each time the draw() function is called, it subtracts that saved time from the current time to get the elapsed milliseconds.