var aNow,aThen,aTime:Longint; begin aThen := GetTickCount(); Sleep(1000);//代码段 aNow := GetTickCount(); aTime := aNow-aThen; ShowMessage(IntToStr(a)); end;