1,需要在环境变量中自定义一个最大超时时间
Environment("MAX_ACTION_TIMEOUT")
2,判断是否超时的方法:
Dim INT_ACTION_STARTTIME_MSEC 'global variable
INT_ACTION_STARTTIME_MSEC = Timer 'start time
Public Function CheckIfActionReachedTimeout()
Dim intElapsedTimeMsec
intElapsedTimeMsec = Timer-INT_ACTION_STARTTIME_MSEC 'calculate time passed
If intElapsedTimeMsec > Environment("MAX_ACTION_TIMEOUT") Then
CheckIfActionReachedTimeout = True
exitaction
else
CheckIfActionReachedTimeout = false
end if
end function
3,使用方法示例代码:
print CheckIfActionReachedTimeout()