alquerci / cpulimit

CPU usage limiter for Windows (Cygwin)
GNU General Public License v3.0
21 stars 11 forks source link

need add code for cpu cores detection #2

Open ai386 opened 7 years ago

ai386 commented 7 years ago

SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); int cores = sysinfo.dwNumberOfProcessors;

and

        case 'l':
            this->SetLimit(atoi(optarg)*cores);
            break;

and

if (l < 1 || l > (100*cores))
{
    fprintf(stderr,"Error: Limit must be in the range 1-100.\n");
    this->m_error += 1;
}
alquerci commented 7 years ago

Hello @ai386,

I invite you to submit a pull request.