feat: added CPU, GPU, ANE, RAM, and PCI powers from IOReport (#2346)

This commit is contained in:
Serhiy Mytrovtsiy
2025-02-08 10:55:48 +01:00
parent 858816107a
commit 9ae1388428
9 changed files with 284 additions and 14 deletions

View File

@@ -202,6 +202,19 @@ public extension Double {
return "\(h)h \(minutes)min"
}
func power(_ unit: String) -> Double {
switch unit {
case "mJ":
return self / 1e3
case "uJ":
return self / 1e6
case "nJ":
return self / 1e9
default:
return 0
}
}
}
public extension NSView {