diff options
| author | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
|---|---|---|
| committer | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
| commit | 55ed12f8d1eb6887d348be03aee5573d44177ffb (patch) | |
| tree | 3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/public/tier0/cpumonitoring.h | |
| parent | * Added support for Visual C++ 2013 Express to VPC (diff) | |
| download | source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip | |
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/public/tier0/cpumonitoring.h')
| -rw-r--r-- | mp/src/public/tier0/cpumonitoring.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mp/src/public/tier0/cpumonitoring.h b/mp/src/public/tier0/cpumonitoring.h new file mode 100644 index 00000000..e6d1c9cd --- /dev/null +++ b/mp/src/public/tier0/cpumonitoring.h @@ -0,0 +1,33 @@ +#ifndef CPU_MONITORING_H +#define CPU_MONITORING_H + +/* +This header defines functions and structures for controlling the measurement of CPU frequency +in order to detect thermal throttling. For details see the associated source file. +*/ + +struct CPUFrequencyResults +{ + double m_timeStamp; // Time (from Plat_FloatTime) when the measurements were made. + float m_GHz; + float m_percentage; + float m_lowestPercentage; +}; + +// Call this to get results. +// When CPU monitoring is 'disabled' it may still be running at a low frequency, +// for OGS purposes or for proactively warning users of problems. If fGetDisabledResults +// is true then results will be returned when disabled (if available). +PLATFORM_INTERFACE CPUFrequencyResults GetCPUFrequencyResults( bool fGetDisabledResults = false ); + +// Call this to set the monitoring frequency. Intervals of 2-5 seconds (2,000 to 5,000 ms) +// are recommended. An interval of zero will disable CPU monitoring. Short delays (below +// about 300 ms) will be rounded up. +PLATFORM_INTERFACE void SetCPUMonitoringInterval( unsigned nDelayMilliseconds ); + +// Warn with increasing strident colors when CPU percentages go below these levels. +// They are const int instead of float because const float in C++ is stupid. +const int kCPUMonitoringWarning1 = 80; +const int kCPUMonitoringWarning2 = 50; + +#endif |