如题~

解决方案 »

  1.   

    aiirii(ari-爱的眼睛) 说得对,建立一个全局变量a,在程序启动时记下当时的时间,需要时用Now-a得到运行时间。P.S. 你的名字是什么意思?怎么跟F1里Bar车队的小日本车手的名字一样??
      

  2.   

    GetTickCount 得到现在时间与windows启动时间之差。
    在代码端开始,结束各取一次,一减就可以了
      

  3.   

    GetTickCount()获取当前时间,算出来
      

  4.   

    在存储过程中用getdate()
    用now
      

  5.   

    先定义一全局变量Tim,在Form的OnCreat事件中建立初始化为Tim:=now;
    然后在Timer中的OnTimer事件中的代码为:
    procedure TForm1.Timer1Timer(Sender: TObject);
    var
       ti:Ttime;
    begin
       ti:=now-Tim;
       showmessage(TimeToStr(ti));
    end;
      

  6.   

    st_sysBar.Panels[3].Text:=SystemServerDateTime;Function SystemServerDateTime:String;            //系统时间
    var
      Query_date:TQuery;
    begin
      Result:='';
      try
        Query_date:=TQuery.Create(nil);
        with Query_date do
        begin
          DatabaseName:=Data_Link.Data_GsmLink.DatabaseName;
          close;
          sql.Clear;
          sql.Add(’select getdate()‘);
          try
            open;
            Result:=FormatDateTime('YYYY-MM-DD HH:MM:SS',Fields[0].AsDateTime);
          except
            Result:='';
          end;
        end;
      finally
        Query_date.Free;
      end;
      

  7.   

    先声明两个变量:t1,t2:DWORD; (Delphi中也有这个数据类型)在程序开始之前,加入一条语句:
    t1:=GetTickCount;
    然后在程序结束时再加入一条语句:
    t2:=GetTickCount;那么t2-t1就是程序执行的时间,单位为毫秒。