  Circular electron positron colliders, such as the CEPC and FCC-ee, have been
proposed to measure Higgs boson properties precisely, test the Standard Model,
search for physics beyond the Standard Model, and so on. One of the important
goals of these colliders is to measure the $W$ boson mass with great precision
by taking data around the $W$-pair production threshold. In this paper, the
data-taking scheme is investigated to maximize the achievable precisions of the
$W$ boson mass and width with a threshold scan, when various systematic
uncertainties are taken into account. The study shows that an optimal and
realistic data-taking scheme is to collect data at three center-of-mass
energies and that precisions of 1.0 MeV and 3.4 MeV can be achieved for the
mass and width of the $W$ boson, respectively, with a total integrated
luminosity of $\mathcal{L}=3.2$~\mbox{ab}$^{-1}$ and several assumptions of the
systematic uncertainty sources.
