Fetched the rows of the record MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ifoel
    New Member
    • Jul 2007
    • 12

    Fetched the rows of the record MySQL

    Hi all
    pls help me

    How to know "HOW MANY SECOND" we fetched the rows of the record MySQL via Visual Basic 6...?

    Sample:
    321 rows Fetched in 0,234s -> i need this field to load on the FORM VB

    thanks in advance
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Just make a note of the system time before and after the database call, and subtract one from the other.

    [CODE=vb]
    Dim StartTime As Date, EndTime As Date
    Dim Elapsed As Double
    StartTime = Now
    ' Do database stuff.
    EndTime = Now
    Elapsed = EndTime - StartTime
    Debug.Print "Elapsed Time : "; Format("hh:nn:s s")
    [/CODE]You can play around to get higher precision. The Date (or Double) variable holds date/time information to much higher precision than a second, so you can have a play with how you display it. One way I have used in the past was to do something like...
    [CODE=vb]Dim OneSecond As Double
    OneSecond = TimeValue("00:0 0:01")
    Debug.Print "Elapsed Time : "; Elapsed / OneSecond; " seconds"[/CODE]This is just off the top of my head, and may require some debugging.

    Comment

    • Ifoel
      New Member
      • Jul 2007
      • 12

      #3
      Ok Killer42...
      this very help full

      thanks again...

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Glad to help. Just keep in mind, a Date variable is really just a slightly different way of looking at a Double value.

        Comment

        Working...