A Timer implementation on javascript