📄 mclthread.~inc
字号:
{ mclThread }
constructor mclThread.Create;
begin
inherited Create(false);
ClassLoadHndl:=CreateEvent(nil, true, false, 'OSCI_engine_load_event');
SetLength(CPUInfo, GetCPUCount);
ifStart:=true;
ifCont:=true;
InfoTimeRef:=20000; ClocksTimeRef:=1000;
InitializeCriticalSection(CriticalSection);
end;
destructor mclThread.Destroy;
var
i: DWord;
begin
ifCont:=false;
for i:=0 to GetCPUCount-1 do
CPUInfo[i].Destroy;
SetLength(CPUInfo, 0);
DeleteCriticalSection(CriticalSection);
inherited Destroy;
end;
procedure mclThread.UpdateInfo;
begin
if not ifCont then exit;
MainFrm.ShowCpuInfo(CurrentCpuNum);
MainFrm.ShowClocksInfo(CurrentCpuNum);
MemInfo.FillMemCtrlInfo(CPUInfo[0].Clocks.lpCpuFrequency, CPUInfo[0].Clocks.Bus, CPUInfo[0].Clocks.Multiplier);
MainFrm.ShowMemoryInfo;
end;
procedure mclThread.UpdateClocks;
begin
if not ifCont then exit;
MainFrm.ShowClocksInfo(CurrentCpuNum);
MemInfo.FillMemCtrlInfo(CPUInfo[0].Clocks.lpCpuFrequency, CPUInfo[0].Clocks.Bus, CPUInfo[0].Clocks.Multiplier);
MainFrm.ShowMemoryInfo;
end;
procedure mclThread.Execute;
var
i: DWord;
ThrSleepTime: Word;
begin
try
while ifCont do begin
ThrSleepTime:=500;
if ifStart then
begin
for i:=0 to GetCPUCount-1 do
CPUInfo[i]:=cCPUid.Create(i);
ifStart:=false;
SetEvent(ClassLoadHndl);
end
else
begin
if InfoTimeCntr>=InfoTimeRef then
begin
InfoTimeCntr:=0;
EnterCriticalSection(CriticalSection);
for i:=0 to GetCPUCount-1 do
CPUInfo[i].FillCPUinfo;
LeaveCriticalSection(CriticalSection);
if ifCont then Synchronize(UpdateInfo);
end
else
begin
InfoTimeCntr:=InfoTimeCntr+ThrSleepTime;
if ClocksTimeCntr>=ClocksTimeRef then
begin
ClocksTimeCntr:=0;
EnterCriticalSection(CriticalSection);
for i:=0 to GetCPUCount-1 do
CPUInfo[i].UpdateClocks;
LeaveCriticalSection(CriticalSection);
if ifCont then Synchronize(UpdateClocks);
end
else
ClocksTimeCntr:=ClocksTimeCntr+ThrSleepTime;
end
end;
sleep(ThrSleepTime);
end;
except
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -