Line | |
---|
1 | /** Various time measuring routines |
---|
2 | @author Jiri Bittner |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef __TIMERS_H |
---|
6 | #define __TIMERS_H |
---|
7 | |
---|
8 | void initTiming(); |
---|
9 | |
---|
10 | void finishTiming(); |
---|
11 | |
---|
12 | long getTime(); |
---|
13 | |
---|
14 | double timeDiff(long t1,long t2); |
---|
15 | |
---|
16 | char * timeString(); |
---|
17 | |
---|
18 | |
---|
19 | /** Example of usage: |
---|
20 | see timers.h for diffirent possibilities of what is really measured. |
---|
21 | |
---|
22 | |
---|
23 | InitTiming(); |
---|
24 | |
---|
25 | long t1, t2, t3; |
---|
26 | |
---|
27 | t1 = GetTime(); |
---|
28 | |
---|
29 | Algortihm1(); |
---|
30 | |
---|
31 | t2 = GetTime(); |
---|
32 | |
---|
33 | Algorithm2(); |
---|
34 | |
---|
35 | t3 = GetTime(); |
---|
36 | |
---|
37 | |
---|
38 | cout<<"Algorithm 1"<<TimeDiff(t1, t2)<<"[ms]"<<endl; |
---|
39 | cout<<"Algorithm 2"<<TimeDiff(t2, t3)<<"[ms]"<<endl; |
---|
40 | |
---|
41 | |
---|
42 | FinishTiming(); |
---|
43 | |
---|
44 | */ |
---|
45 | |
---|
46 | |
---|
47 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.