A simple JavaScript timer