Fix timer so that it counts seconds rather than relying on time().