MYNT EYE D SDK  1.7.1
http://www.myntai.com/mynteye/depth
rate.h
1 // Copyright 2018 Slightech Co., Ltd. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef MYNTEYE_UTIL_RATE_H_
15 #define MYNTEYE_UTIL_RATE_H_
16 #pragma once
17 
18 #include "mynteyed/util/times.h"
19 
20 MYNTEYE_BEGIN_NAMESPACE
21 
22 class MYNTEYE_API Rate {
23  public:
24  using clock = times::clock;
25 
26  explicit Rate(std::int32_t frequency);
27  ~Rate();
28 
29  void Sleep();
30 
31  void Reset();
32 
33  clock::duration CycleTime();
34 
35  clock::duration ExpectedCycleTime();
36 
37  private:
38  clock::time_point time_beg_;
39  clock::duration expected_cycle_time_, actual_cycle_time_;
40 };
41 
42 MYNTEYE_END_NAMESPACE
43 
44 #endif // MYNTEYE_UTIL_RATE_H_
Definition: rate.h:22