RsStatistics.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include <chrono>
7 
9 {
10 public:
11  static std::chrono::high_resolution_clock::time_point& getResetPacketStartTp()
12  {
13  static std::chrono::high_resolution_clock::time_point tpResetPacketStart = std::chrono::high_resolution_clock::now();
14  return tpResetPacketStart;
15  }
16  static std::chrono::high_resolution_clock::time_point& getFirstPacketTp()
17  {
18  static std::chrono::high_resolution_clock::time_point tpFirstPacket = std::chrono::high_resolution_clock::now();
19  return tpFirstPacket;
20  }
21  static std::chrono::high_resolution_clock::time_point& getSendPacketTp()
22  {
23  static std::chrono::high_resolution_clock::time_point tpSendPacket = std::chrono::high_resolution_clock::now();
24  return tpSendPacket;
25  }
26  static std::chrono::high_resolution_clock::time_point& getScheduleTp()
27  {
28  static std::chrono::high_resolution_clock::time_point tpSchedule = std::chrono::high_resolution_clock::now();
29  return tpSchedule;
30  }
31  static double& getPrevDiff()
32  {
33  static double prevDiff = 0;
34  return prevDiff;
35  }
36  static double isJump()
37  {
38  double* prevDiff = &getPrevDiff();
39  double diff = 1000 * std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - RsStatistics::getSendPacketTp()).count();
40  double diffOfDiff = diff - *prevDiff;
41  if(diffOfDiff > 5)
42  {
43  *prevDiff = diff;
44  return diffOfDiff;
45  }
46  else
47  {
48  *prevDiff = diff;
49  return 0;
50  }
51  }
52 };
static std::chrono::high_resolution_clock::time_point & getSendPacketTp()
Definition: RsStatistics.h:21
static double & getPrevDiff()
Definition: RsStatistics.h:31
static std::chrono::high_resolution_clock::time_point & getScheduleTp()
Definition: RsStatistics.h:26
static std::chrono::high_resolution_clock::time_point & getFirstPacketTp()
Definition: RsStatistics.h:16
static double isJump()
Definition: RsStatistics.h:36
static std::chrono::high_resolution_clock::time_point & getResetPacketStartTp()
Definition: RsStatistics.h:11
GLint GLsizei count


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41