Need code snippet for benchmarking a process. 
Author Message
 Need code snippet for benchmarking a process.

I need to test the speed of a process like connecting to a db and fetching
the resultset, or how long it takes to filter some data on a dataset.  heres
some suto code of what im looking for:

Starttime = now

Process some code here (like parse an xmldoc)

Endtime = now

ProcessTime = Endtime - Starttime.

I'm looking for something with better resolution than milliseconds.

Thanks.

--
George Padvorac



Mon, 27 Dec 2004 01:45:27 GMT  
 Need code snippet for benchmarking a process.
Try something like this:

Shared Sub Main(args() As String)

   Dim test As System.Collections.ArrayList
   Dim start As DateTime = DateTime.Now

  'Whatever you want to test

   Dim span As System.TimeSpan = DateTime.Now - start
   Console.WriteLine(("time is " + span.TotalMilliseconds / 1000 + "ms"))
End Sub 'Main

This should give you to the microsec....

HTH

David

Quote:
> I need to test the speed of a process like connecting to a db and fetching
> the resultset, or how long it takes to filter some data on a dataset.
heres
> some suto code of what im looking for:

> Starttime = now

> Process some code here (like parse an xmldoc)

> Endtime = now

> ProcessTime = Endtime - Starttime.

> I'm looking for something with better resolution than milliseconds.

> Thanks.

> --
> George Padvorac




Mon, 27 Dec 2004 05:59:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Code Snippet Needed

2. Code Snippet Needed

3. Code Database Program - Store your code Snippets

4. Code Database Program- Store your code snippets

5. Benchmarking a block of code

6. NEEDED: sample VB code for Excel 97 worksheet processing

7. samples code snippets?

8. combobox: converting code snippet from VBA to VB

9. Code Snippet: Browse for Folder

10. Code snippet storage

11. Network Adapter MAC address code snippet

12. whats wrong in this code snippet?

 

 
Powered by phpBB® Forum Software