GDCM  2.4.5
gdcmARTIMTimer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef GDCMARTIMTIMER_H
19 #define GDCMARTIMTIMER_H
20 
21 namespace gdcm {
22  namespace network{
39 {
40  private:
41  double mStartTime; //ms timing should be good enough, but there are also
42  //high-resolution timing options. Those return doubles. For now,
43  //go with integer timing solutions based on milliseconds (DWORD on windows),
44  //but leave as doubles to ease transitions to other timing methods.
45 
46  double mTimeOut;
47  //once GetCurrentTime() -mStartTime > mTimeout, GetHasExpired returns true.
48 
49  double GetCurrentTime() const;//a platform-specific implementation of getting the
50  //current time.
51 
52  public:
53  ARTIMTimer(); //initiates the start and timeout at -1;
54  void Start(); //'start' the timer by getting the current wall time
55  void Stop();//'stop' the timer by resetting the 'start' to -1;
56  void SetTimeout(double inTimeout);
57  double GetTimeout() const;
58 
59  double GetElapsedTime() const;
60 
61  bool GetHasExpired() const;
62 
63  };
64  }
65 }
66 
67 #endif //GDCMARTIMTIMER_H
bool GetHasExpired() const
double GetTimeout() const
double GetElapsedTime() const
void SetTimeout(double inTimeout)
ARTIMTimer This file contains the code for the ARTIM timer.
Definition: gdcmARTIMTimer.h:38
Definition: gdcmASN1.h:20

Generated on Fri Sep 25 2015 17:58:22 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo