我在 windos下的devcpp 上测是不开O2有 3.7s,开O2有 1.8s。
我在 linux下viscode 上测,用这个语句 g++ temp1.cpp -o temp1 -std=c++14 -O2 -g -Wall -Wextra -fsanitize=address,undefined && time ./temp1 测,得出:
real 0m3.982s
user 0m3.711s
sys 0m0.207s
这似乎并不是开 O2 后的运行时间,求解答那怎么才能查看开 O2 的运行时间?