Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jacobsapps/b6bb1760527c9432379dc04fb7d830c4 to your computer and use it in GitHub Desktop.
Save jacobsapps/b6bb1760527c9432379dc04fb7d830c4 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