Revision 10,
777 bytes
checked in by gametools, 20 years ago
(diff) |
vienna university of technology first files
|
Line | |
---|
1 | // ================================================================ |
---|
2 | // $Id: Timers.h,v, 1.1.1.1 2004/10/12 12:49:13 matt Exp $ |
---|
3 | // **************************************************************** |
---|
4 | // |
---|
5 | /** \file time.h |
---|
6 | |
---|
7 | Various time measuring routines |
---|
8 | |
---|
9 | @author Jiri Bittner |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef __TIMERS_H |
---|
13 | #define __TIMERS_H |
---|
14 | |
---|
15 | void initTiming(); |
---|
16 | |
---|
17 | void finishTiming(); |
---|
18 | |
---|
19 | long getTime(); |
---|
20 | |
---|
21 | double timeDiff(long t1,long t2); |
---|
22 | |
---|
23 | char * timeString(); |
---|
24 | |
---|
25 | |
---|
26 | /** Example of usage: |
---|
27 | see timers.h for diffirent possibilities of what is really measured.. |
---|
28 | |
---|
29 | |
---|
30 | InitTiming(); |
---|
31 | |
---|
32 | long t1, t2, t3; |
---|
33 | |
---|
34 | t1 = GetTime(); |
---|
35 | |
---|
36 | Algortihm1(); |
---|
37 | |
---|
38 | t2 = GetTime(); |
---|
39 | |
---|
40 | Algorithm2(); |
---|
41 | |
---|
42 | t3 = GetTime(); |
---|
43 | |
---|
44 | |
---|
45 | cout<<"Algorithm 1"<<TimeDiff(t1, t2)<<"[ms]"<<endl; |
---|
46 | cout<<"Algorithm 2"<<TimeDiff(t2, t3)<<"[ms]"<<endl; |
---|
47 | |
---|
48 | |
---|
49 | FinishTiming(); |
---|
50 | |
---|
51 | */ |
---|
52 | |
---|
53 | |
---|
54 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.