THashedStringlist 应用实例

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IniFiles, Buttons; type TForm1 = class(TForm) BitBtn1: TBitBtn; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public FCacheConfigList: THashedStringlist; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var t: Cardinal; i: Integer; begin t := GetTickCount; FCacheConfigList.Clear; for i := 1 to 10000 do begin randomize(); FCacheConfigList.Add(IntToStr(Random(10000))); end; FCacheConfigList.Sort; ShowMessage(IntToStr(GetTickCount - t)); ShowMessage(IntToStr(FCacheConfigList.Count)); end; procedure TForm1.FormCreate(Sender: TObject); begin FCacheConfigList := THashedStringlist.Create; end; end.

你可能感兴趣的:(windows,Random,Class,button,Forms)