Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

  1. #ifndef CPU_MONITORING_H
  2. #define CPU_MONITORING_H
  3. /*
  4. This header defines functions and structures for controlling the measurement of CPU frequency
  5. in order to detect thermal throttling. For details see the associated source file.
  6. */
  7. struct CPUFrequencyResults
  8. {
  9. double m_timeStamp; // Time (from Plat_FloatTime) when the measurements were made.
  10. float m_GHz;
  11. float m_percentage;
  12. float m_lowestPercentage;
  13. };
  14. // Call this to get results.
  15. // When CPU monitoring is 'disabled' it may still be running at a low frequency,
  16. // for OGS purposes or for proactively warning users of problems. If fGetDisabledResults
  17. // is true then results will be returned when disabled (if available).
  18. PLATFORM_INTERFACE CPUFrequencyResults GetCPUFrequencyResults( bool fGetDisabledResults = false );
  19. // Call this to set the monitoring frequency. Intervals of 2-5 seconds (2,000 to 5,000 ms)
  20. // are recommended. An interval of zero will disable CPU monitoring. Short delays (below
  21. // about 300 ms) will be rounded up.
  22. PLATFORM_INTERFACE void SetCPUMonitoringInterval( unsigned nDelayMilliseconds );
  23. // Warn with increasing strident colors when CPU percentages go below these levels.
  24. // They are const int instead of float because const float in C++ is stupid.
  25. const int kCPUMonitoringWarning1 = 80;
  26. const int kCPUMonitoringWarning2 = 50;
  27. #endif