请问在GUI中如何计时?一直没找到直接计时的命令,谢谢先!
无 上面不是有两个小时钟的么?starttimer("001")这个命令不能直接输出啊,只能在日志里看,还有别的命令吗,谢谢
1 如果要求精度不是很高的话,你可以用以下方式输出到Console中::d
Sub Main
Dim Start_time
Dim End_time
Dim Total_time
Start_time = time
'执行的语句
End_time =time
Total_time = End_time - Start_time
SQAConsoleWrite("脚本运行用时共:"&Total_time)
End Sub 可惜,只能精确到秒。哪位还有别的好办法?:) 那就只能调用API函数拉。Robot可以调用系统函数
Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Declare function GetDay() as string
'系统的日期信息,精确到毫秒
function GetDay() as string
dim systime as systemtime
GetLocalTime systime
GetDay=cstr(systime.wYear) + "-" + cstr(systime.wMonth) + "-" + cstr(systime.wDay)+" "+cstr(systime.wHour)+":"+cstr(systime.wMinute)+":"+cstr(systime.wSecond)+":"+cstr(systime.wMilliseconds)
end function
页:
[1]