The scheduler of your operating system should take care of this for you in milliseconds, not seconds. The details depend on which OS you are running on, but one general approach is that when the scheduler is running on an idle processor, it checks to see if it can steal a thread from another processor with too many. This quickly balances the threads of all processors.
As a rule, if you need to establish the proximity of the processor, either you have a very specific and unusual use case, or your operating system has an error.
source share