CppBenchmark  1.0.4.0
C++ Benchmark Library
system.h
Go to the documentation of this file.
1 
9 #ifndef CPPBENCHMARK_SYSTEM_H
10 #define CPPBENCHMARK_SYSTEM_H
11 
12 #include <cstdint>
13 #include <string>
14 
15 namespace CppBenchmark {
16 
18 
21 class System
22 {
23 public:
24  System() = delete;
25  System(const System&) = delete;
26  System(System&&) = delete;
27  ~System() = delete;
28 
29  System& operator=(const System&) = delete;
30  System& operator=(System&&) = delete;
31 
33  static std::string CpuArchitecture();
35  static int CpuLogicalCores();
37  static int CpuPhysicalCores();
39  static std::pair<int, int> CpuTotalCores();
41  static int64_t CpuClockSpeed();
43  static bool CpuHyperThreading();
44 
46  static int64_t RamTotal();
48  static int64_t RamFree();
49 
51  static uint64_t CurrentThreadId();
52 
54  static uint64_t Timestamp();
55 
57  static uint64_t MulDiv64(uint64_t operant, uint64_t multiplier, uint64_t divider);
58 };
59 
60 } // namespace CppBenchmark
61 
62 #endif // CPPBENCHMARK_SYSTEM_H
System management static class.
Definition: system.h:22
System(System &&)=delete
System & operator=(System &&)=delete
static std::pair< int, int > CpuTotalCores()
CPU total cores count.
Definition: system.cpp:182
static uint64_t Timestamp()
Get the current timestamp in nanoseconds.
Definition: system.cpp:378
static int CpuPhysicalCores()
CPU physical cores count.
Definition: system.cpp:177
static std::string CpuArchitecture()
CPU architecture string.
Definition: system.cpp:128
System(const System &)=delete
static uint64_t CurrentThreadId()
Current thread Id.
Definition: system.cpp:367
static int64_t RamFree()
Free RAM in bytes.
Definition: system.cpp:331
static int64_t CpuClockSpeed()
CPU clock speed in Hz.
Definition: system.cpp:255
static bool CpuHyperThreading()
Is CPU Hyper-Threading enabled?
Definition: system.cpp:299
static int64_t RamTotal()
Total RAM in bytes.
Definition: system.cpp:305
static uint64_t MulDiv64(uint64_t operant, uint64_t multiplier, uint64_t divider)
Calculate (operant * multiplier / divider) with 64-bit unsigned integer values.
Definition: system.cpp:429
static int CpuLogicalCores()
CPU logical cores count.
Definition: system.cpp:172
System & operator=(const System &)=delete
C++ Benchmark project definitions.
Definition: barrier.h:15