By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

Fetched the rows of the record MySQL

P: 12
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
Aug 14 '07 #1
Share this Question
Share on Google+
3 Replies


Expert 5K+
P: 8,434
Just make a note of the system time before and after the database call, and subtract one from the other.

Expand|Select|Wrap|Line Numbers
  1. Dim StartTime As Date, EndTime As Date
  2. Dim Elapsed As Double
  3. StartTime = Now
  4. ' Do database stuff.
  5. EndTime = Now
  6. Elapsed = EndTime - StartTime
  7. Debug.Print "Elapsed Time : "; Format("hh:nn:ss")
  8.  
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...
Expand|Select|Wrap|Line Numbers
  1. Dim OneSecond As Double
  2. OneSecond = TimeValue("00:00:01")
  3. Debug.Print "Elapsed Time : "; Elapsed / OneSecond; " seconds"
This is just off the top of my head, and may require some debugging.
Aug 14 '07 #2

P: 12
Ok Killer42...
this very help full

thanks again...
Aug 14 '07 #3

Expert 5K+
P: 8,434
Glad to help. Just keep in mind, a Date variable is really just a slightly different way of looking at a Double value.
Aug 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.