View Full Version : تنظيم ميزان استفاده برنامه از CPU
kpour2001
یک شنبه 05 آبان 1387, 20:19 عصر
میخواستم بدونم چطوری میشه ميزان استفاده برنامه از CPU رو تنظیم کرد
مثلا jetaudio برای convert کردن ویدئو این امکان رو میده که چقدر از قدرت cpu رو استفاده کنه
عکس اونو ضمیمه کردم
rostamkhani
دوشنبه 06 آبان 1387, 00:00 صبح
سلام
فکر کنم با Priority که در Thread هست بشه .
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
System.Threading.Thread thr = new System.Threading.Thread(WindowsFormsApplication1.F orm1.sub);
thr.Priority = System.Threading.ThreadPriority.Lowest;
thr.Start();
}
public static void sub()
{
string str;
for (int i = 1; i < 100000; i++)
{
for (int j = 0; j < 10000; j++)
{
str= (i * j).ToString();
}
}
Application.VisualStyleState=System.Windows.Forms. VisualStyles.VisualStyleState.NoneEnabled;
}
}
mohammad272005
دوشنبه 06 آبان 1387, 01:16 صبح
ببخشید اسن خط یعنی چی؟
Application.VisualStyleState=System.Windows.Forms. VisualStyles.VisualStyleState.NoneEnabled
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.