D djtop Unregistered / Unconfirmed GUEST, unregistred user! 2006-05-23 #1 写了两个算法,想在程序里比较一下两个算法的执行时间,delphi怎么实现
晚 晚起的小虫 Unregistered / Unconfirmed GUEST, unregistred user! 2006-05-23 #2 var t1,t2 ,t:integer; begin t:=GetTickCount; //算法1; t1:=GetTickCount-t; //取得运算时间,毫秒级 t:=GetTickCount; //算法2; t2:=GetTickCount-t; //取得运算时间,毫秒级 end; 这种方法有些受到环境影响,不过基本准确。
var t1,t2 ,t:integer; begin t:=GetTickCount; //算法1; t1:=GetTickCount-t; //取得运算时间,毫秒级 t:=GetTickCount; //算法2; t2:=GetTickCount-t; //取得运算时间,毫秒级 end; 这种方法有些受到环境影响,不过基本准确。