Simulated annealing from continuum to discretization: a convergence analysis via the Eyring--Kramers law