var tStart,tEnd,m:integer;
tStart:=GetTickCount;
...
tEnd:=GetTickCount;
m:=(tStart-tEnd) div 60;
tStart:=GetTickCount;
...
tEnd:=GetTickCount;
m:=(tStart-tEnd) div 60;
解决方案 »
- 如何判断时间走了多少
- 提取字符串中的汉字
- 请问谁知道WM_USER+4和WM_USER+47413在Delphi中被定义成什么消息,是由什么事件激发的?
- 哪有丰富的mtv(mpeg文件格式)下载?
- 请问,怎样模拟一个组合键?
- 网络问题(NMMsg)
- 关于查询的一个问题?
- 表A中有ID、NAME,一个ID对应一个NAME,现在新建了B表,也有这两个字段,只填写了ID,用什么语句把A表中的NAME相应地加入B表?
- installshield 创建快捷方式 添加BDE engine等若干问题
- 一些基本的问题,答必有分!
- 一个关于文件 Reset 的问题!
- 谁能用最快时间为oracle插入10000条记录可得100分
//秒数
m:=(tStart-tEnd)/1000;
//分数。
m:=m/60;
begin
date1:=now;
label1.caption:=datetimetostr(date1);
end;procedure TForm1.Button2Click(Sender: TObject);
begin
date2:=now;
label2.caption:=datetimetostr(date2);
showmessage(timetostr(date1-date2));
end;
function Tform1.GetMaskString(S,Mask:string;Position:integer):string;
var Str:string;
i,Len:integer;
begin
Str:='';
for i:=0 to Position -1 do
begin
if (Pos(Mask,S)<=0) then //最后
begin
Str:=S;
Break;
end;
Str:=Copy(S,1,Pos(Mask,S)-1);
Len:=Length(Str);
S:=Copy(S,Len+2,Length(S)-Len-1);
end;
Result:=Str;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
date1:=now;
label1.caption:=datetimetostr(date1);
end;procedure TForm1.Button2Click(Sender: TObject);
var S,sec,min,hour:string;
h,m,se:integer;
begin
date2:=now;
label2.caption:=datetimetostr(date2);
S:=timetostr(date1-date2);
hour:=GetMaskString(S,':',1);
min:=GetMaskString(S,':',2);
sec:=GetMaskString(S,':',3); h:=strtoint(hour)*60;
se:=strtoint(sec) div 60;
m:=strtoint(min);
showmessage('我要的时间差是:'+inttostr(h+m+se)+'分钟');
end;
我的OICQ是:1766465希望和你成为朋友!呵呵,不过我可是菜鸟呀!
Datetime := Datetime2 - Datetime1;
year := Decodedate()
month :=...
date := ...
hh := Decodetime()
mm := ....
ss := ....
怎么处理,应该知道了吧!
//----------do something
CTime time2=CTime::GetCurrentTime();
CTimeSpan timeSpan=time2-tim1;
int nMinutes=timeSpan.GetTotalSecond/60;