Log the bookmark check time to a file

Top  Previous  Next

This example calculates the time of a check and writes the number of seconds to a csv log file (c:\wswlogs\log23.txt).


The number of seconds are also written into the additional info field #1 that can be displayed as column in the bookmark list.


 Dim sLogfile = "c:\wswlogs\log23.txt"

 Dim dStart


Sub Wsw_BeforeCheck(Handle)

   Bookmark_SetProperty(Handle, "checkmethod", "content")

   dStart = Now

End Sub




Sub Wsw_AfterCheck(Handle, ByRef sStatusMessage)


   Dim sSeconds = CStr(Trunc((Now - dStart) * 24 * 60 * 60))


   ' Write seconds into additional info field/column

   Bookmark_SetProperty(Handle, "infofield1", sSeconds + " sec")


   ' Write URL and seconds into log file

   If sLogfile <> "" Then

      AddStringToFile(sLogfile, """" + Bookmark_GetProperty(Handle, "check_url") + """;""" + sSeconds + """" + CRLF)

   End If


End Sub