We conducted observations of multiple HC3N (J = 10−9, 12−11, and 16−15) lines and the N2H+ (J = 1−0) line toward a large sample of 61 ultracompact (UC) H ii regions, through the Institut de Radioastronomie Millmétrique 30 m and the Arizona Radio Observatory 12 m telescopes. The N2H+
J = 1−0 line is detected in 60 sources and HC3N is detected in 59 sources, including 40 sources with three lines, 9 sources with two lines, and 10 sources with one line. Using the rotational diagram, the rotational temperature and column density of HC3N were estimated toward sources with at least two HC3N lines. For 10 sources with only one HC3N line, their parameters were estimated, taking one average value of T
rot. For N2H+, we estimated the optical depth of the N2H+
J = 1−0 line, based on the line intensity ratio of its hyperfine structure lines. Then the excitation temperature and column density were calculated. When combining our results in UC H ii regions and previous observation results on high-mass starless cores, the N(HC3N)/N(N2H+) ratio clearly increases from the region stage. This means that the abundance ratio changes with the evolution of high-mass star-forming regions (HMSFRs). Moreover, positive correlations between the ratio and other evolutionary indicators (dust temperature, bolometric luminosity, and luminosity-to-mass ratio) are found. Thus we propose the ratio of N(HC3N)/N(N2H+) as a reliable chemical clock of HMSFRs.