controlling number of processor cores on your machine

I have a quad-core and oct-core machines and one of the things I generally do is to run my code only on single core. However to do this one needs to boot OS with single core configuration. With windows it is fairly easy to do:

  1. Go to run (Windows + R button)
  2. type msconfig
  3. press enter
    MSConfig
  4. In boot click Advanced options.. button

  5. Check Number of Processors and pick the count

    Selecting Number of Processors

  6. reboot

After rebooting if you bring up task manager, it will show only one processor instead of usual 48:

If you want to revert back to old setting, just uncheck the Number of Processors check box from step 5 and reboot: