Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created August 3, 2025 12:14
Show Gist options
  • Save jacobsapps/d8fba98525e5815f107b6efe3288b971 to your computer and use it in GitHub Desktop.
Save jacobsapps/d8fba98525e5815f107b6efe3288b971 to your computer and use it in GitHub Desktop.
let thermalRating = switch ProcessInfo.processInfo.thermalState {
case .nominal:
return 0
case .fair:
return 1
/// System performance may be impacted.
/// Reduce CPU, GPU, I/O, and visual effects if possible.
case .serious:
return 2
/// System performance is significantly impacted
/// Reduce CPU, GPU, I/O, and camera usage ASAP.
case .critical:
return 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment