日別アーカイブ: 2013年7月20日

24日目+29 シンプルなストップウォッチ


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.