CppBenchmark 1.0.5.0
C++ Benchmark Library
Loading...
Searching...
No Matches
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
15namespace CppBenchmark {
16
18
21class System
22{
23public:
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
static std::pair< int, int > CpuTotalCores()
CPU total cores count.
Definition system.cpp:183
static uint64_t Timestamp()
Get the current timestamp in nanoseconds.
Definition system.cpp:399
static int CpuPhysicalCores()
CPU physical cores count.
Definition system.cpp:178
static std::string CpuArchitecture()
CPU architecture string.
Definition system.cpp:129
System & operator=(const System &)=delete
System(const System &)=delete
static uint64_t CurrentThreadId()
Current thread Id.
Definition system.cpp:388
static int64_t RamFree()
Free RAM in bytes.
Definition system.cpp:352
static int64_t CpuClockSpeed()
CPU clock speed in Hz.
Definition system.cpp:270
static bool CpuHyperThreading()
Is CPU Hyper-Threading enabled?
Definition system.cpp:320
static int64_t RamTotal()
Total RAM in bytes.
Definition system.cpp:326
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:450
static int CpuLogicalCores()
CPU logical cores count.
Definition system.cpp:173
System & operator=(System &&)=delete
C++ Benchmark project definitions.
Definition barrier.h:15