计算并输出程序运行时间的DMIS例子。
DECL/CHAR,10,CH1
DECL/CHAR,10,CM1
DECL/CHAR,10,CS1
DECL/CHAR,10,CH2
DECL/CHAR,10,CM2
DECL/CHAR,10,CS2
DECL/INTGR,IH1
DECL/INTGR,IM1
DECL/INTGR,IS1
DECL/INTGR,IH2
DECL/INTGR,IM2
DECL/INTGR,IS2
DECL/INTGR,ALLS1
DECL/INTGR,ALLS2
DECL/INTGR,ALLS
$$计算机当前时间
KNPTC1 = ASSIGN/STIME()
$$得到小时、分钟、秒的值
CH1 = ASSIGN/SUBSTR(KNPTC1,1,2)
CM1 = ASSIGN/SUBSTR(KNPTC1,4,5)
CS1 = ASSIGN/SUBSTR(KNPTC1,7,8)
IH1 = ASSIGN/VAL(CH1)
IM1 = ASSIGN/VAL(CM1)
IS1 = ASSIGN/VAL(CS1)
ALLS1 = ASSIGN/(IH1*3600+IM1*60+IS1)
$$循环示例开始
(UP)
KNPTC2 = ASSIGN/STIME()
CH2 = ASSIGN/SUBSTR(KNPTC2,1,2)
CM2 = ASSIGN/SUBSTR(KNPTC2,4,5)
CS2 = ASSIGN/SUBSTR(KNPTC2,7,8)
IH2 = ASSIGN/VAL(CH2)
IM2 = ASSIGN/VAL(CM2)
IS2 = ASSIGN/VAL(CS2)
ALLS2 = ASSIGN/(IH2*3600+IM2*60+IS2)
ALLS = ASSIGN/(ALLS2-ALLS1)
if/(ALLS.GE.1)
JUMPTO/(NEXT)
ELSE
JUMPTO/(UP)
ENDIF
(NEXT)
WRITE/DID(DEFAULTSCREEN),KNPTC1
WRITE/DID(DEFAULTSCREEN),KNPTC2
TEXT/OUTFIL,'本次测试总共用时:'
WRITE/DID(DEFAULTSCREEN),ALLS