home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / vbprof.zip / PROFDAT.BAS < prev    next >
BASIC Source File  |  1995-09-03  |  2KB  |  52 lines

  1. Option Explicit
  2. Dim protbs                  As String * 1
  3. Dim FirstTick               As Long
  4. Dim fastFile                As Integer
  5. Declare Function ProGetTickCount Lib "user" Alias "GetTickCount" () As Long
  6.  
  7. Sub vbfProfileIn (fName As String, fArg As String)
  8. Dim Ticks As Long
  9. Dim temp$
  10.     If FirstTick = 0 Then
  11.         If Dir$("vbprof.dat") <> "" Then Kill "vbprof.dat"
  12.         FirstTick = ProGetTickCount()
  13.         protbs = Chr$(9)
  14.         fastFile = FreeFile
  15.         Open "vbprof.dat" For Append As fastFile
  16.     End If
  17.     Print #fastFile, "In" + protbs + fName + protbs + Str(ProGetTickCount() - FirstTick) + protbs + fArg
  18. End Sub
  19.  
  20. Sub vbfProfileOut (fName As String)
  21.     Print #fastFile, "Out" + protbs + fName + protbs + Str$(ProGetTickCount() - FirstTick)
  22. End Sub
  23.  
  24. Sub vbProfileIn (fName As String, fArg As String)
  25. Dim FileNr As Integer, Ticks As Long
  26. Dim temp$
  27.     If FirstTick = 0 Then
  28.         If Dir$("vbprof.dat") <> "" Then Kill "vbprof.dat"
  29.         FirstTick = ProGetTickCount()
  30.         protbs = Chr$(9)
  31.     End If
  32.     Ticks = ProGetTickCount() - FirstTick
  33.     temp$ = "In" + protbs + fName + protbs + Str(Ticks) + protbs + fArg
  34.     FileNr = FreeFile
  35.     Open "vbprof.dat" For Append As FileNr
  36.         Print #FileNr, temp$
  37.     Close FileNr
  38. End Sub
  39.  
  40. Sub vbProfileOut (fName As String)
  41. Dim FileNr As Integer, Ticks As Long
  42. Dim temp$
  43.     If FirstTick = 0 Then FirstTick = ProGetTickCount()
  44.     Ticks = ProGetTickCount() - FirstTick
  45.     temp$ = "Out" + protbs + fName + protbs + Str$(Ticks)
  46.     FileNr = FreeFile
  47.     Open "vbprof.dat" For Append As FileNr
  48.         Print #FileNr, temp$
  49.     Close FileNr
  50. End Sub
  51.  
  52.