Web Wispers 1.2.2 C++ Unit Test Coverage |
|
|
|
|
Branch data Line data Source code
1 : : /*
2 : : * Copyright 2006-2009 Savarese Software Research Corporation
3 : : *
4 : : * Licensed under the Apache License, Version 2.0 (the "License");
5 : : * you may not use this file except in compliance with the License.
6 : : * You may obtain a copy of the License at
7 : : *
8 : : * https://www.savarese.com/software/ApacheLicense-2.0
9 : : *
10 : : * Unless required by applicable law or agreed to in writing, software
11 : : * distributed under the License is distributed on an "AS IS" BASIS,
12 : : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 : : * See the License for the specific language governing permissions and
14 : : * limitations under the License.
15 : : */
16 : :
17 : : /**
18 : : * @file
19 : : * This header defines the Timer class.
20 : : */
21 : :
22 : : #ifndef __SSRC_WSPR_UTILITY_TIMER_H
23 : : #define __SSRC_WSPR_UTILITY_TIMER_H
24 : :
25 : : #include <ssrc/wispers-packages.h>
26 : : #include <ssrc/wisp/utility/TimeValue.h>
27 : :
28 : : __BEGIN_NS_SSRC_WSPR_UTILITY
29 : :
30 : : using NS_SSRC_WISP_UTILITY::TimeValue;
31 : :
32 : 1 : class Timer {
33 : : TimeValue _start, _stop;
34 : :
35 : : public:
36 : :
37 : 1 : const TimeValue & start() {
38 : 1 : return _start.now_mono();
39 : : }
40 : :
41 : 1 : const TimeValue & stop() {
42 : 1 : return _stop.now_mono();
43 : : }
44 : :
45 : : const TimeValue & start_time() {
46 : : return _start;
47 : : }
48 : :
49 : : const TimeValue & stop_time() {
50 : : return _stop;
51 : : }
52 : :
53 : 1 : TimeValue elapsed() const {
54 : 1 : return (_stop - _start);
55 : : }
56 : : };
57 : :
58 : :
59 : : __END_NS_SSRC_WSPR_UTILITY
60 : :
61 : : #endif
|
Copyright © 2017 Savarese Software Research Corporation. All rights reserved