XDSoft 发表于 2021-1-16 00:53:24

关于系统变量TDUSRTIMER 和 AcDbDate对象

问题:

About TDUSRTIMER and AcDbDate

解答:

The TDUSRTIMER system variable does not store the elapsed milliseconds, but instead stores the time elapsed form the last reset in a Julian date format. The easiest way to get the time elapsed in seconds is to use the AcDbDate class.


void ASDKgetTime()
{
struct resbuf rUsrTime;
acedGetVar(_T("TDUSRTIMER"), &rUsrTime);

AcDbDate testDate ;
testDate.setJulianFraction(rUsrTime.resval.rreal) ;

acutPrintf (
    _T("\nMinute: %d\nSec: %d\nMilisec: %d"),
    testDate.minute (),
    testDate.second (),
    testDate.millisecond ()) ;
}


页: [1]
查看完整版本: 关于系统变量TDUSRTIMER 和 AcDbDate对象