(1)对于绘制50%直线,程序代码为: [cpp] view plaincopyprint? #include #include #include int _tmain(int argc,_TCHAR* argv[]) { int busyTime = 10; int idleTime = busyTime*5; __int64 startTime = 0; ::SetThreadAffinityMask(::GetCurrentProcess(),0x00000001); while(true) { startTime = GetTickCount(); //busy loop while((GetTickCount() - startTime) <= busyTime); //idle loop Sleep(idleTime); } return 0; }