feat(menubar): 拆分紧凑双页面板并按页采样
This commit is contained in:
@@ -14,6 +14,12 @@ nonisolated struct ProcessMetrics: Identifiable, Sendable {
|
||||
let footprintBytes: UInt64? // Physical footprint; never RSS.
|
||||
let threads: Int?
|
||||
let restricted: Bool
|
||||
var cpuPower: Double? = nil // Average attributed CPU power, watts; not Energy Impact.
|
||||
var powerWindow: TimeInterval? = nil
|
||||
var formattedPower: String {
|
||||
guard let cpuPower, cpuPower.isFinite, cpuPower >= 0 else { return "--" }
|
||||
return cpuPower >= 1 ? String(format: "%.2f W", cpuPower) : String(format: "%.1f mW", cpuPower * 1000)
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated struct ProcessSnapshot: Sendable {
|
||||
|
||||
Reference in New Issue
Block a user