Issue
I saw an answer to a question regarding timing which used __sync_synchronize().
Solution
It is a atomic builtin for full memory barrier.
No memory operand will be moved across the operation, either forward or backward. Further, instructions will be issued as necessary to prevent the processor from speculating loads across the operation and from queuing stores after the operation.
Check details on the link above.
Answered By - nik Answer Checked By - Candace Johnson (WPSolving Volunteer)