Measure before you optimize, change one thing, and measure again. The clock for measuring in C++ is std::chrono::steady_clock: it never jumps backward, unlike the system clock, which can be adjusted while your program runs. Read auto t0 = std::chrono::steady_clock::now(); before the work and subtract it from a reading after; std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count() turns the difference into a number.
One measurement is noise. Run the operation many times, store each duration in a buffer allocated beforehand, and report the distribution. The median says what is typical; a high percentile such as the 99th says how bad the slow cases get, and that is what latency budgets are written against. An average hides both. The nearest-rank percentile p of n sorted samples is the sample at rank ceil(p times n / 100), counting from 1.
Timings in a browser tab are rough and vary from run to run, so the tests check the measuring code rather than the speed: they feed it fake clocks with known readings, spin on the real clock for a known minimum time, and count allocations while samples are recorded.
Two readings of the steady clock around the work, stored as nanoseconds.