unit untStopWatch;
interface
uses
Windows;
type
TStopWatch = class
private
StartCount: Integer;
procedure Reset;
public
procedure Start;
function Time : Integer;
end;
var
StopWatch: TStopWatch;
implementation
procedure TStopWatch.Reset;
begin
StartCount := GetTickCount;
end;
procedure TStopWatch.Start;
begin
Reset();
end;
function TStopWatch.Time: Integer;
begin
Result := GetTickCount - StartCount;
end;
end.
24日目+29 シンプルなストップウォッチ
コメントをどうぞ