如何将一个时间差转化为秒? starttime= CTime::GetCurrentTime(); endtime= CTime::GetCurrentTime(); result=endtime-starttime;请问怎么将这个result转化为秒? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好像上面的 “-” 无法实现,那么我怎样得到starttime到endtime之间的时间间隔(单位为秒):starttime= CTime::GetCurrentTime(); endtime= CTime::GetCurrentTime(); time_t starttime,endtime;time(&starttime);......time(&endtime);endtime-starttime; // example for CTime::operator +, -CTime t1( 1999, 3, 19, 22, 15, 0 ); // 10:15PM March 19, 1999CTime t2( 1999, 3, 20, 22, 15, 0 ); // 10:15PM March 20, 1999CTimeSpan ts = t2 - t1; // Subtract 2 CTimesASSERT( ts.GetTotalSeconds() == 86400L );ASSERT( ( t1 + ts ) == t2 ); // Add a CTimeSpan to a CTime.ASSERT( ( t2 - ts ) == t1 ); // Subtract a CTimeSpan from a Ctime. vc变成弹出USB设备 QQ中的抓屏功能是怎么实现的? 关于使用微软MSCOMM串口控件的问题 有什么办法可以用 vc6.0打开 用 vc.net建立的项目?? 急!关于实时存储数据问题! 300高分征求一小小程序 谁能帮我解释下 如何开发中文输入法 COM组件程序的卸载时机是什么? 高薪聘高手 图像识别问题,请高手赐教! 菜鸟提问,关于显示隐藏自定义工具栏的问题
那么我怎样得到starttime到endtime之间的时间间隔(单位为秒):
starttime= CTime::GetCurrentTime();
endtime= CTime::GetCurrentTime();
time(&starttime);
......
time(&endtime);
endtime-starttime;
CTime t1( 1999, 3, 19, 22, 15, 0 ); // 10:15PM March 19, 1999
CTime t2( 1999, 3, 20, 22, 15, 0 ); // 10:15PM March 20, 1999
CTimeSpan ts = t2 - t1; // Subtract 2 CTimes
ASSERT( ts.GetTotalSeconds() == 86400L );
ASSERT( ( t1 + ts ) == t2 ); // Add a CTimeSpan to a CTime.
ASSERT( ( t2 - ts ) == t1 ); // Subtract a CTimeSpan from a Ctime.