AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
systemtime.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJA_TIME_H
9  #define AJA_TIME_H
10 
11 #if defined(AJA_USE_CPLUSPLUS11) && !defined(AJA_BAREMETAL)
12  // If compiling with C++11, by default, implementation uses STL chrono & thread.
13  #ifndef AJA_SLEEP_USE_STL
14  #define AJA_SLEEP_USE_STL // Sleep... functions use STL chrono/thread; comment this out to use native impl
15  #endif
16  // #ifndef AJA_SYSCLK_USE_STL
17  // #define AJA_SYSCLK_USE_STL // GetSystem... functions use STL chrono; comment this out to use native impl (TBD)
18  // #endif
19 #endif // AJA_USE_CPLUSPLUS11
20 
21 // #define AJA_COLLECT_SLEEP_STATS // Define this to allow thread-specific stat collection for Sleep & SleepInMicroseconds
22  #include "ajabase/common/public.h"
23  #if defined(AJA_COLLECT_SLEEP_STATS)
24  #include <string>
25  #endif // defined(AJA_COLLECT_SLEEP_STATS)
26 
32  {
33  public:
34 
39  static int64_t GetSystemTime (void);
40 
45  static int64_t GetSystemCounter (void);
46 
51  static int64_t GetSystemFrequency (void);
52 
57  static double GetSystemSeconds (void);
58 
63  static uint64_t GetSystemMilliseconds (void);
64 
69  static uint64_t GetSystemMicroseconds (void);
70 
75  static uint64_t GetSystemNanoseconds (void);
76 
81  static void Sleep (const int32_t inMilliseconds);
82 
87  static void SleepInMicroseconds (const int32_t inMicroseconds);
88 
93  static void SleepInNanoseconds (const uint64_t inNanoseconds);
94 
95  #if defined(AJA_COLLECT_SLEEP_STATS)
96  static bool CollectSleepStats (const bool inEnable = true);
97  static std::string GetSleepStats (void);
98  #endif // AJA_COLLECT_SLEEP_STATS
99  }; // AJATime
100 
101 #endif // AJA_TIME_H
AJA_EXPORT
#define AJA_EXPORT
Definition: export.h:34
public.h
Master header for the ajabase library.
AJATime
Collection of platform-independent host system clock time functions.
Definition: systemtime.h:31