Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect Time ?

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
US
When I make a connection with the remote host, I get a system message in the bottom right hand corner that tells me the time connected. Is there a property that I can access through Aspect that will tell me this ?

ToddWW
 
I'm not aware of a method to get this information from a script. One workaround that I can think of if is to use a when $CARRIER command to call a procedure to set a long global variable with the current value of $LTIME. You would want this procedure to do this only if $CARRIER was equal to 1, indicating that a connection currently existed. The script could then subtract that value from the current value of $LTIME at some point in the future to get the elapsed time of the current connection. Here's a rough start on such a script. Some formatting would need to be done on the time displayed in the status line as it doesn't break down into hours, minutes, and seconds.

long lStartTime

proc main
long lDiffTime

when $CARRIER call start_timer

while 1
yield
lDiffTime = $LTIME - lStartTime
statmsg "Current connection time = %d" lDiffTime
endwhile
endproc

proc start_timer
if $CARRIER == 1
lStartTime = $LTIME
endif
endproc

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top