Yes, a sufficiently smart compiler can always tell you’re doing a benchmark and delete it. It’s just unlikely.