/[projects]/dao/DaoMqPump2/DaoCommon/ElapsedTimer.cs
ViewVC logotype

Annotation of /dao/DaoMqPump2/DaoCommon/ElapsedTimer.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2164 - (hide annotations) (download)
Fri May 16 17:59:47 2014 UTC (10 years ago) by torben
File size: 729 byte(s)
Add DaoCommon
1 torben 2164 using System;
2     using System.Collections.Generic;
3     using System.Text;
4    
5     namespace DaoCommon
6     {
7     public class ElapsedTimer
8     {
9     long start;
10    
11     public ElapsedTimer()
12     {
13     startTimer(); //Constructor also starts the timer
14     }
15    
16    
17     public void startTimer()
18     {
19     start = DateTime.Now.Ticks;
20     }
21    
22     public void stopAndPrint(string msg)
23     {
24     long stop = DateTime.Now.Ticks;
25    
26     long elapsed = (stop - start) / 10000; //omreg tidsforskel til millisekunder
27    
28    
29     Console.WriteLine( msg + " took " + elapsed + " milliseconds ");
30    
31     startTimer(); //when done reset timer
32     }
33     }
34     }

  ViewVC Help
Powered by ViewVC 1.1.20