We investigate a semimetal-superconductor phase transition of two-dimensional Dirac electrons at zero temperature by large-scale and essentially unbiased quantum Monte Carlo simulations for the half-filled attractive Hubbard model on the triangular lattice, in the presence of alternating magnetic $pi$-flux, that is introduced to construct two Dirac points in the one-particle bands at the Fermi level. This phase transition is expected to describe quantum criticality of the chiral XY class in the framework of the Gross-Neveu model, where, in the ordered phase, the $U(1)$ symmetry is spontaneously broken and a mass gap opens in the excitation spectrum. We compute the order parameter of the s-wave superconductivity and estimate the quasiparticle weight from the long-distance behavior of the single-particle Greens function. These calculations allow us to obtain the critical exponents of this transition in a reliable and accurate way. Our estimate for the critical exponents is in good agreement with those obtained for a transition to a Kekul{e} valence bond solid, where an emergent $U(1)$ symmetry is proposed [Z.-X. Li et al., Nat. Commun. 8, 314 (2017)].