Помагbте с проектом в delphi

Помагbте с проектом в delphi
unit Unit4;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
TForm4 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Label1: TLabel;
Memo2: TMemo;
Memo3: TMemo;
Memo4: TMemo;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);

private
function GetMemoryTotalPhys: dword;
function getCPUSpeed: Double;
{ Private declarations }
public
{ Public declarations }
end;

var
Form4: TForm4;
const
id_bit=$200000;
implementation

{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);
var lpDisplayDevice:TdisplayDevice;
dwFlags:dword;
cc:dword;
memorymb:cardinal;
s:integer;

begin ///////////////////////////////////////////
lpDisplayDevice.cb:= sizeof(lpDisplayDevice); //
dwFlags := 0; //
cc:= 0; // video
while EnumDisplayDevices(nil,cc,lpDisplayDevice,dwflags)do //
begin //
inc(cc); //
memo1.Lines.Add(lpDisplayDevice.DeviceString); //
////////////////////////////////////////////////////////
memoryMb:=GetMemoryTotalPhys; // ram
memorymb:=((memorymb div 1024)div 1024); //
memo2.text:=('RAM: '+ inttostr(memoryMB)+ ' MB'); //
//////////////////////////////////////////////////////
for s:=1 to 30 do /////////////////////////////////////////
if DiskFree(s)<>-1 then //
begin //
memo3.Lines.Add(chr(s+64)+':'); //
memo1.Text:=memo1.Text+floattostrF(Disksize(s)/ //
1048576,ffFixed,10,2)+'MB Capacity'; // hard
memo3.Text:=memo3.Text+'....'; //
memo3.Text:=memo3.Text+floattostrf(Diskfree(s)/ //
1048576,ffFixed,10,2)+'mb free Space'; //
//////////////////////////////////////////////////////////

end;
end;

end;

function GetCPUSpeed: Double;
const
DelayTime = 500;
var
TimerHi, TimerLo: DWORD;
PriorityClass, Priority: Integer;
begin
try
PriorityClass := GetPriorityClass(GetCurrentProcess);
Priority := GetThreadPriority(GetCurrentThread);

SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread,THREAD_PRIORITY_TIME_CRITICAL);

Sleep(10);
asm
dw 310Fh // rdtsc
mov TimerLo, eax
mov TimerHi, edx
end;
Sleep(DelayTime);
asm
dw 310Fh // rdtsc
sub eax, TimerLo
sbb edx, TimerHi
mov TimerLo, eax
mov TimerHi, edx
end;

SetThreadPriority(GetCurrentThread, Priority);
SetPriorityClass(GetCurrentProcess, PriorityClass);

Result := TimerLo / (1000.0 * DelayTime);
except end;
end;

function TForm4.GetMemoryTotalPhys: dword;
var recmemorystatus:Tmemorystatus;
begin
recmemorystatus.dwLength:=sizeof(Tmemorystatus);
GlobalMemoryStatus(recMemoryStatus);
result:=recmemorystatus.dwTotalPhys;
end;

end.

  • да , строка *unit Unit4*
    написана верна.
    какой вопрос - такой и ответ
  • надо писать
    function TForm4.GetCPUSpeed: Double;
    const
    DelayTime = 500;
    ...