CString sql="select * from test";m_pRecordset.CreateInstance("ADODB.Recordset");
m_pRecordset->Open((_variant_t)sql,_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);这是我用ado打开表的语句,我想得到打开这个表需要的时间,并把它显示在一个edit框里,比如说用了26秒540毫秒,edit框就显示"26540",高手帮忙啊!!

解决方案 »

  1.   

    CTime a = CTime::GetCurrentTime();
    打开过程
    CTime b = CTime::GetCurrentTime();
    CTimeSpan c= b-a;
    CString tst;
    tst.Format("%d..",c.gethou());
      

  2.   

    对了CTime精度不够。
    用 GetTickt();
      

  3.   

    对!就用GetTickCount();
    The return value is the number of milliseconds that have elapsed since the system was started
      

  4.   

    不好意思,菜鸟不会使用GetTickCount();请高手帮忙!!
      

  5.   

    GetTickCount()的用法参考:
    http://expert.csdn.net/Expert/topic/2147/2147520.xml?temp=.4915583