DataFlex
DataFlex
Measure Elapsed Time with the Convenience Timer
See more Socket/SSL/TLS Examples
Demonstrates Socket.StartTiming, which starts or restarts the object's convenience timer. The ElapsedSeconds property then reports the whole number of seconds since the call.
Background. This timer is a convenience for measuring durations and does not affect connection behavior or timeouts.
Chilkat DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoSocket
Integer iTemp1
Get Create (RefClass(cComChilkatSocket)) To hoSocket
If (Not(IsComObjectCreated(hoSocket))) Begin
Send CreateComObject of hoSocket
End
// Start (or restart) the object's convenience timer.
Send ComStartTiming To hoSocket
// Perform some work. (Here the thread simply sleeps to let time pass.)
Send ComSleepMs To hoSocket 1500
// Read the whole number of seconds elapsed since StartTiming was called.
Get ComElapsedSeconds Of hoSocket To iTemp1
Showln "Elapsed seconds: " iTemp1
End_Procedure