1 mike 1.1 //BEGIN_LICENSE
2 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
20 //END_LICENSE
21 //BEGIN_HISTORY
22 mike 1.1 //
23 // Author: Mike Brasher
24 //
|
25 karl 1.2 // $Log: Stopwatch.h,v $
|
26 mike 1.6 // Revision 1.5 2001/04/10 23:01:52 mike
27 // Added new TimeValue class and regression tests for it.
28 // Modified Stopwatch class to use TimeValue class.
29 //
|
30 mike 1.5 // Revision 1.4 2001/04/08 19:20:04 mike
31 // more TCP work
32 //
|
33 mike 1.4 // Revision 1.3 2001/02/17 20:09:23 mike
34 // new
35 //
|
36 mike 1.3 // Revision 1.2 2001/02/17 19:58:54 karl
37 // Add Linkage
38 //
|
39 karl 1.2 // Revision 1.1 2001/02/16 02:08:26 mike
40 // Renamed several classes
41 //
|
42 mike 1.1 //
43 //END_HISTORY
44
45 #ifndef Pegasus_Stopwatch_h
46 #define Pegasus_Stopwatch_h
47
48 #include <Pegasus/Common/Config.h>
|
49 mike 1.5 #include <Pegasus/Common/TimeValue.h>
|
50 mike 1.6 #include <Pegasus/Common/System.h>
|
51 mike 1.1
52 PEGASUS_NAMESPACE_BEGIN
53
|
54 karl 1.2 /** Stopwatch - A class for measuring elapsed time
|
55 mike 1.5 Stopwatch is a class for measuring time intervals within the environment.
56 It is intended to be a developers tool primarily.
|
57 mike 1.1 */
|
58 mike 1.3 class PEGASUS_COMMON_LINKAGE Stopwatch
|
59 mike 1.1 {
60 private:
|
61 mike 1.5 TimeValue _start;
|
62 mike 1.1
63 public:
|
64 karl 1.2
65 /** stopwatch constructor. The constructor creates the object and
66 starts the timer
67 @example Stopwatch time;
68 */
|
69 mike 1.1 Stopwatch();
70
|
71 karl 1.2 /** Reset Stopwatch resets an existing Stopwatch object to the
72 current time value
73 */
|
74 mike 1.1 void reset();
75
|
76 karl 1.2 /** getElapsed - Get the elapsed time for the defined stopwatch.
77 @return Returns the elapsed time value as a double
78 */
|
79 mike 1.1 double getElapsed() const;
80
|
81 karl 1.2 /** printElapsed method sends the current value of the timer and
82 sends it to standardout as a string with the word seconds attached
83 */
|
84 mike 1.1 void printElapsed();
85 };
86
87 PEGASUS_NAMESPACE_END
88
89 #endif /* Pegasus_Stopwatch_h */
|